Sha256: 05e99bd6e0a1434829916ea1ead600284b4354aef4d41e25c6cc25e4617bb133

Contents?: true

Size: 521 Bytes

Versions: 2

Compression:

Stored size: 521 Bytes

Contents

RSpec::Matchers.define :be_installed do
  match do |name|
    if @provider.nil?
      backend.check_installed(name)
    else
      check_method = "check_installed_by_#{@provider}".to_sym

      unless backend.respond_to?(check_method)
        raise ArgumentError.new("`be_installed` matcher doesn't support #{@under}")
      end

      backend.send(check_method, name, @version)
    end
  end

  chain :by do |provider|
    @provider = provider
  end

  chain :with_version do |version|
    @version = version
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
serverspec-0.2.4 lib/serverspec/matchers/be_installed.rb
serverspec-0.2.3 lib/serverspec/matchers/be_installed.rb