class Serverspec::Type::RabbitmqBase

Public Class Methods

new(name = nil, options = {}) click to toggle source
Calls superclass method Serverspec::Type::ApiBase::new
# File lib/serverspec_extra_types/types/rabbitmq_base.rb, line 11
def initialize(name = nil, options = {})
  super(name, options)
  @user = ENV['RABBITMQ_USER'] || 'guest'
  @password = ENV['RABBITMQ_PASSWORD'] || 'guest'
  @url_base = property[:variables][:rabbitmq_url] || 'http://localhost:15672'
end

Public Instance Methods

inspection() click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_base.rb, line 18
def inspection
  @inspection ||= ::MultiJson.load(get_inspection.stdout)[0]
end
length() click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_base.rb, line 22
def length
  if inspection.is_a? String
    inspection.length
  elsif inspection.is_a? Array
    inspection.length
  else
    1
  end
end

Private Instance Methods

extra_args() click to toggle source
# File lib/serverspec_extra_types/types/rabbitmq_base.rb, line 34
def extra_args
  "-u #{@user}:#{@password}"
end
get_inspection() click to toggle source

rubocop:disable Naming/AccessorMethodName

# File lib/serverspec_extra_types/types/rabbitmq_base.rb, line 39
def get_inspection
  command = curl_command
  @get_inspection ||= @runner.run_command(command)
end