~nvalcarcel/ubuntu/lucid/puppet/fix-546677

« back to all changes in this revision

Viewing changes to spec/unit/provider/zfs/solaris.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
        @provider = provider_class.new(@resource)
13
13
    end
14
14
 
 
15
    it "should have a create method" do
 
16
        @provider.should respond_to(:create)
 
17
    end
 
18
 
 
19
    it "should have a destroy method" do
 
20
        @provider.should respond_to(:destroy)
 
21
    end
 
22
 
 
23
    it "should have an exists? method" do
 
24
        @provider.should respond_to(:exists?)
 
25
    end
 
26
 
15
27
    describe "when calling add_properties" do
16
28
        it "should add -o and the key=value for each properties with a value" do
17
29
            @resource.stubs(:[]).with(:quota).returns ""
37
49
        end
38
50
    end
39
51
 
40
 
    describe "when calling delete" do
 
52
    describe "when calling destroy" do
41
53
        it "should call zfs with :destroy and this zfs" do
42
54
            @provider.expects(:zfs).with(:destroy, @resource[:name])
43
 
            @provider.delete
 
55
            @provider.destroy
44
56
        end
45
57
    end
46
 
   
 
58
 
47
59
    describe "when calling exist?" do
48
60
        it "should call zfs with :list" do
49
61
            #return stuff because we have to slice and dice it
50
62
            @provider.expects(:zfs).with(:list).returns("NAME USED AVAIL REFER MOUNTPOINT\nmyzfs 100K 27.4M /myzfs")
51
63
            @provider.exists?
52
64
        end
53
 
        
54
 
        it "should return true if returned values match the name" do 
 
65
 
 
66
        it "should return true if returned values match the name" do
55
67
            @provider.stubs(:zfs).with(:list).returns("NAME USED AVAIL REFER MOUNTPOINT\n#{@resource[:name]} 100K 27.4M /myzfs")
56
68
            @provider.exists?.should == true
57
69
        end
60
72
            @provider.stubs(:zfs).with(:list).returns("no soup for you")
61
73
            @provider.exists?.should == false
62
74
        end
63
 
            
 
75
 
64
76
    end
65
77
 
66
78
    [:mountpoint, :compression, :copies, :quota, :reservation, :sharenfs, :snapdir].each do |prop|