summaryrefslogtreecommitdiffstats
path: root/test/language
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-03 18:20:04 -0500
committerLuke Kanies <luke@madstop.com>2007-09-03 18:20:04 -0500
commit9d70b9746c09f648efd6a315b3ea088da38ecd1e (patch)
treea8e7335d58008e1e24ed854703b1b9d54cc5a68d /test/language
parentb021587e309f237bd16bd4f5cc51e79266cbd222 (diff)
downloadpuppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.tar.gz
puppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.tar.xz
puppet-9d70b9746c09f648efd6a315b3ea088da38ecd1e.zip
Removing the Scope#setresource method, since it was essentially redundant. The work is done in either AST::ResourceDef#evaluate or Compile#store_resource.
Diffstat (limited to 'test/language')
-rwxr-xr-xtest/language/collector.rb14
-rwxr-xr-xtest/language/functions.rb6
2 files changed, 9 insertions, 11 deletions
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")