Sha256: 9bbff495e6a6dbe76ab1d6ca80400a6dabb78c103c2f8df3981ec2876dad6a41

Contents?: true

Size: 366 Bytes

Versions: 10

Compression:

Stored size: 366 Bytes

Contents

RSpec::Matchers.define :be_enabled do
  match do |subject|
    if subject.class.name == 'Serverspec::Type::Service'
      subject.enabled?(@level)
    else
      subject.enabled?
    end
  end

  description do
    message = 'be enabled'
    message << " with level #{@level}" if @level
    message
  end

  chain :with_level do |level|
    @level = level
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
serverspec-2.36.1 lib/serverspec/matcher/be_enabled.rb
serverspec-2.36.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.35.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.34.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.33.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.32.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.31.1 lib/serverspec/matcher/be_enabled.rb
serverspec-2.31.0 lib/serverspec/matcher/be_enabled.rb
serverspec-2.30.1 lib/serverspec/matcher/be_enabled.rb
serverspec-2.30.0 lib/serverspec/matcher/be_enabled.rb