Class: Serverspec::Type::RabbitmqBase
- Defined in:
- lib/serverspec_extra_types/types/rabbitmq_base.rb
Direct Known Subclasses
RabbitmqNodeList, RabbitmqUserPermission, RabbitmqVhostList, RabbitmqVhostPolicy
Instance Method Summary collapse
-
#initialize(name = nil, options = {}) ⇒ RabbitmqBase
constructor
A new instance of RabbitmqBase.
- #inspection ⇒ Object
- #length ⇒ Object
Methods inherited from ApiBase
Constructor Details
#initialize(name = nil, options = {}) ⇒ RabbitmqBase
Returns a new instance of RabbitmqBase.
11 12 13 14 15 16 |
# File 'lib/serverspec_extra_types/types/rabbitmq_base.rb', line 11 def initialize(name = nil, = {}) super(name, ) @user = ENV['RABBITMQ_USER'] || 'guest' @password = ENV['RABBITMQ_PASSWORD'] || 'guest' @url_base = property[:variables][:rabbitmq_url] || 'http://localhost:15672' end |
Instance Method Details
#inspection ⇒ Object
18 19 20 |
# File 'lib/serverspec_extra_types/types/rabbitmq_base.rb', line 18 def inspection @inspection ||= ::MultiJson.load(get_inspection.stdout)[0] end |
#length ⇒ Object
22 23 24 25 26 27 28 29 30 |
# 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 |