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

« back to all changes in this revision

Viewing changes to spec/unit/property/list.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:
118
118
            end
119
119
        end
120
120
 
121
 
        describe "when calling insync?" do
 
121
       describe "when calling insync?" do
122
122
            it "should return true unless @should is defined and not nil" do
123
 
                @property.insync?("foo") == true
 
123
                @property.must be_insync("foo")
124
124
            end
125
125
 
126
126
            it "should return true unless the passed in values is not nil" do
127
127
                @property.should = "foo"
128
 
                @property.insync?(nil) == true
 
128
                @property.must be_insync(nil)
129
129
            end
130
130
 
131
131
            it "should call prepare_is_for_comparison with value passed in and should" do
135
135
                @property.insync?("bar")
136
136
            end
137
137
 
138
 
            it "should return true if prepared value == should value" do
 
138
            it "should return true if 'is' value is array of comma delimited should values" do
139
139
                @property.should = "bar,foo"
140
140
                @property.expects(:inclusive?).returns(true)
141
 
                @property.insync?(["bar","foo"]).must == true
 
141
                @property.must be_insync(["bar","foo"])
 
142
            end
 
143
 
 
144
            it "should return true if 'is' value is :absent and should value is empty string" do
 
145
                @property.should = ""
 
146
                @property.expects(:inclusive?).returns(true)
 
147
                @property.must be_insync([])
142
148
            end
143
149
 
144
150
            it "should return false if prepared value != should value" do
145
151
                @property.should = "bar,baz,foo"
146
152
                @property.expects(:inclusive?).returns(true)
147
 
                @property.insync?(["bar","foo"]).must == false
 
153
                @property.must_not be_insync(["bar","foo"])
148
154
            end
149
155
        end
150
156