~ubuntu-branches/ubuntu/oneiric/puppet/oneiric-security

« back to all changes in this revision

Viewing changes to spec/unit/provider/confine.rb

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock
  • Date: 2009-04-13 17:12:47 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (3.1.3 squeeze) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20090413171247-61zlnwi5esw1lhtv
ImportĀ upstreamĀ versionĀ 0.24.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    end
35
35
 
36
36
    describe "when testing all values" do
37
 
        before { @confine = Puppet::Provider::Confine.new(%w{a b c}) }
 
37
        before do
 
38
            @confine = Puppet::Provider::Confine.new(%w{a b c})
 
39
            @confine.label = "foo"
 
40
        end
38
41
 
39
42
        it "should be invalid if any values fail" do
40
43
            @confine.stubs(:pass?).returns true
51
54
            @confine.expects(:pass?).once.returns false
52
55
            @confine.valid?
53
56
        end
 
57
 
 
58
        it "should log failing confines with the label and message" do
 
59
            @confine.stubs(:pass?).returns false
 
60
            @confine.expects(:message).returns "My message"
 
61
            @confine.expects(:label).returns "Mylabel"
 
62
            Puppet.expects(:debug).with("Mylabel: My message")
 
63
            @confine.valid?
 
64
        end
54
65
    end
55
66
 
56
67
    describe "when testing the result of the values" do