Sha256: 5455ad173cda82def9dbe6631d6b4a600b02b25995fa911458a876dcfaf29854

Contents?: true

Size: 539 Bytes

Versions: 10

Compression:

Stored size: 539 Bytes

Contents

module Serverspec
  module Type
    class Package < Base
      def installed?(provider, version)
        if provider.nil?
          backend.check_installed(nil, @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 #{provider}")
          end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
serverspec-0.5.3 lib/serverspec/type/package.rb
serverspec-0.5.2 lib/serverspec/type/package.rb
serverspec-0.5.1 lib/serverspec/type/package.rb
serverspec-0.5.0 lib/serverspec/type/package.rb
serverspec-0.4.14 lib/serverspec/type/package.rb
serverspec-0.4.13 lib/serverspec/type/package.rb
serverspec-0.4.12 lib/serverspec/type/package.rb
serverspec-0.4.11 lib/serverspec/type/package.rb
serverspec-0.4.10 lib/serverspec/type/package.rb
serverspec-0.4.9 lib/serverspec/type/package.rb