Sha256: c2f30b456153141fc25e5b576c600e6b03041b26202690ee7fe9e9510b5a7083

Contents?: true

Size: 674 Bytes

Versions: 5

Compression:

Stored size: 674 Bytes

Contents

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

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

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

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

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

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
serverspec-0.5.8 lib/serverspec/matchers/be_installed.rb
serverspec-0.5.7 lib/serverspec/matchers/be_installed.rb
serverspec-0.5.6 lib/serverspec/matchers/be_installed.rb
serverspec-0.5.5 lib/serverspec/matchers/be_installed.rb
serverspec-0.5.4 lib/serverspec/matchers/be_installed.rb