spec/unit/provider/service/upstart_spec.rb
# We have a separate method here because our search for the upstart daemon
# confine expects it to be the last confine declared in the upstart provider.
# If in the future we add other confines below it or change its order, these
# unit tests will fail. Placing knowledge of where this confine is located
# in one place makes updating it less painful in case we ever need to do this.
We have a separate method here because our search for the upstart daemon
confine expects it to be the last confine declared in the upstart provider.
If in the future we add other confines below it or change its order, these
unit tests will fail. Placing knowledge of where this confine is located
in one place makes updating it less painful in case we ever need to do this.
We have a separate method here because our search for the upstart daemon confine expects it to be the last confine declared in the upstart provider . If in the future we add other confines below it or change its order these unit tests will fail . Placing knowledge of where this confine is located in one place makes updating it less painful in case we ever need to do this .
def assert_upstart_daemon_existence_confine_is(expected_value)
      provider_class = Puppet::Type.type(:service).provider(:upstart)
      upstart_daemon_existence_confine = provider_class.confine_collection.instance_variable_get(:@confines)[-1]
      expect(upstart_daemon_existence_confine.valid?).to be(expected_value)
    end
def assert_upstart_daemon_existence_confine_is ( expected_value ) provider_class = Puppet :: Type . type ( :service ) . provider ( :upstart ) upstart_daemon_existence_confine = provider_class . confine_collection . instance_variable_get ( :@confines ) [ - 1 ] expect ( upstart_daemon_existence_confine . valid? ) . to be ( expected_value ) end
We have a separate method here because our search for the upstart daemon
confine expects it to be the last confine declared in the upstart provider.
We have a separate method here because our search for the upstart daemon confine expects it to be the last confine declared in the upstart provider .
# Reload our provider to evaluate the :confine block
expected_value
<not_specific>