Sha256: 78c0cad029019cbf5ae9e949819cd184cdccbcbbb85f253a91939f836f3bb139

Contents?: true

Size: 529 Bytes

Versions: 13

Compression:

Stored size: 529 Bytes

Contents

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

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
serverspec-0.6.7 lib/serverspec/type/package.rb
serverspec-0.6.6 lib/serverspec/type/package.rb
serverspec-0.6.5 lib/serverspec/type/package.rb
serverspec-0.6.4 lib/serverspec/type/package.rb
serverspec-0.6.3 lib/serverspec/type/package.rb
serverspec-0.6.2 lib/serverspec/type/package.rb
serverspec-0.6.1 lib/serverspec/type/package.rb
serverspec-0.6.0 lib/serverspec/type/package.rb
serverspec-0.5.8 lib/serverspec/type/package.rb
serverspec-0.5.7 lib/serverspec/type/package.rb
serverspec-0.5.6 lib/serverspec/type/package.rb
serverspec-0.5.5 lib/serverspec/type/package.rb
serverspec-0.5.4 lib/serverspec/type/package.rb