~ubuntu-branches/ubuntu/karmic/puppet/karmic-security

« back to all changes in this revision

Viewing changes to spec/unit/parser/resource.rb

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Pollock
  • Date: 2009-04-13 17:12:47 UTC
  • mfrom: (1.1.9 upstream) (3.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090413171247-qou3gsiihama09cm
Tags: 0.24.8-1
* New upstream release
* debian/control: Add Nigel Kersten and myself as uploaders
* debian/changelog: wrap long lines
* debian/watch: ignore release candidates
* debian/compat: bump to 5
* debian/control: bump Standards-Version (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        end
45
45
    end
46
46
 
 
47
    it "should use the file lookup module" do
 
48
        Puppet::Parser::Resource.ancestors.should be_include(Puppet::FileCollection::Lookup)
 
49
    end
 
50
 
47
51
    it "should be isomorphic if it is builtin and models an isomorphic type" do
48
52
        Puppet::Type.type(:file).expects(:isomorphic?).returns(true)
49
53
        @resource = Puppet::Parser::Resource.new(:type => "file", :title => "whatever", :scope => @scope, :source => @source).isomorphic?.should be_true
176
180
            @resource["noop"].should == "false"
177
181
        end
178
182
 
 
183
        it "should copy all metaparams that it finds" do
 
184
            @scope.setvar("require", "container")
 
185
            @scope.setvar("notify", "container")
 
186
 
 
187
            @resource.class.publicize_methods(:add_metaparams)  { @resource.add_metaparams }
 
188
 
 
189
            @resource["require"].should == "container"
 
190
            @resource["notify"].should == "container"
 
191
        end
 
192
 
179
193
        it "should stack relationship metaparams from its container if it already has them" do
180
194
            @resource.set_parameter("require", "resource")
181
195
            @scope.setvar("require", "container")