~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to spec/integration/provider/package_spec.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env rspec
2
2
require 'spec_helper'
3
3
 
4
 
describe "Package Provider", :'fails_on_ruby_1.9.2' => true do
 
4
describe "Package provider", :'fails_on_ruby_1.9.2' => true do
 
5
  include PuppetSpec::Files
 
6
 
5
7
  Puppet::Type.type(:package).providers.each do |name|
6
8
    provider = Puppet::Type.type(:package).provider(name)
7
9
 
8
10
    describe name, :if => provider.suitable? do
9
11
      it "should fail when asked to install an invalid package" do
10
12
        pending("This test hangs forever with recent versions of RubyGems") if provider.name == :gem
11
 
        pkg = Puppet::Type.newpackage :name => "nosuch#{provider.name}", :provider => provider.name
 
13
 
 
14
        options = {:name => "nosuch#{provider.name}", :provider => provider.name}
 
15
        # The MSI provider requires that source be specified as it is
 
16
        # what actually determines if the package exists.
 
17
        if provider.name == :msi
 
18
          options[:source] = tmpfile("msi_package")
 
19
        end
 
20
 
 
21
        pkg = Puppet::Type.newpackage(options)
12
22
        lambda { pkg.provider.install }.should raise_error
13
23
      end
14
24
 
15
 
      it "should be able to get a list of existing packages" do
 
25
      it "should be able to get a list of existing packages", :fails_on_windows => true do
16
26
        provider.instances.each do |package|
17
27
          package.should be_instance_of(provider)
18
28
          package.properties[:provider].should == provider.name