From 9d70b9746c09f648efd6a315b3ea088da38ecd1e Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 3 Sep 2007 18:20:04 -0500 Subject: Removing the Scope#setresource method, since it was essentially redundant. The work is done in either AST::ResourceDef#evaluate or Compile#store_resource. --- test/language/collector.rb | 14 ++++++-------- test/language/functions.rb | 6 +++--- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'test/language') diff --git a/test/language/collector.rb b/test/language/collector.rb index 18d88a2c4..55c93c2d5 100755 --- a/test/language/collector.rb +++ b/test/language/collector.rb @@ -46,8 +46,8 @@ class TestCollector < Test::Unit::TestCase :virtual => true, :params => {:owner => "root"}) two = mkresource(:type => "file", :title => "/tmp/virtual2", :virtual => true, :params => {:owner => "root"}) - @scope.setresource one - @scope.setresource two + @scope.compile.store_resource @scope, one + @scope.compile.store_resource @scope, two # Now run the collector again and make sure it finds our resource assert_nothing_raised do @@ -68,7 +68,7 @@ class TestCollector < Test::Unit::TestCase # Now add our third resource three = mkresource(:type => "file", :title => "/tmp/virtual3", :virtual => true, :params => {:owner => "root"}) - @scope.setresource three + @scope.compile.store_resource @scope, three # Run the collection assert_nothing_raised do @@ -84,12 +84,12 @@ class TestCollector < Test::Unit::TestCase # Make a virtual resource virtual = mkresource(:type => "file", :title => "/tmp/virtual", :virtual => true, :params => {:owner => "root"}) - @scope.setresource virtual + @scope.compile.store_resource @scope, virtual # And a non-virtual real = mkresource(:type => "file", :title => "/tmp/real", :params => {:owner => "root"}) - @scope.setresource real + @scope.compile.store_resource @scope, real # Now make a collector coll = nil @@ -163,7 +163,7 @@ class TestCollector < Test::Unit::TestCase # Make a resource one = mkresource(:type => "file", :title => "/tmp/virtual1", :virtual => true, :params => {:owner => "root"}) - @scope.setresource one + @scope.compile.store_resource @scope, one # Now perform the collection again, and it should still be there assert_nothing_raised do @@ -176,5 +176,3 @@ class TestCollector < Test::Unit::TestCase assert_equal(false, one.virtual?, "One was not realized") end end - -# $Id$ diff --git a/test/language/functions.rb b/test/language/functions.rb index dbb66e95e..6cea89066 100755 --- a/test/language/functions.rb +++ b/test/language/functions.rb @@ -320,7 +320,7 @@ class TestLangFunctions < Test::Unit::TestCase virtual = mkresource(:type => type, :title => title, :virtual => true, :params => {}) - scope.setresource virtual + scope.compile.store_resource(scope, virtual) ref = Puppet::Parser::Resource::Reference.new( :type => type, :title => title, @@ -387,9 +387,9 @@ class TestLangFunctions < Test::Unit::TestCase "Multiple falses were somehow true") # Now make sure we can test resources - scope.setresource mkresource(:type => "file", :title => "/tmp/rahness", + scope.compile.store_resource(scope, mkresource(:type => "file", :title => "/tmp/rahness", :scope => scope, :source => scope.source, - :params => {:owner => "root"}) + :params => {:owner => "root"})) yep = Puppet::Parser::Resource::Reference.new(:type => "file", :title => "/tmp/rahness") nope = Puppet::Parser::Resource::Reference.new(:type => "file", :title => "/tmp/fooness") -- cgit