summaryrefslogtreecommitdiffstats
path: root/test/language/scope.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-15 18:02:16 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-15 18:02:16 +0000
commitd9fdd8ec2cb2db0c98e48d49cfde689aec51abf5 (patch)
tree0fee2c4604b2547ffd1ccd1bbcf77599316a43e4 /test/language/scope.rb
parentba57dff26b717113a4a7e0bb73bd099a684776e5 (diff)
downloadpuppet-d9fdd8ec2cb2db0c98e48d49cfde689aec51abf5.tar.gz
puppet-d9fdd8ec2cb2db0c98e48d49cfde689aec51abf5.tar.xz
puppet-d9fdd8ec2cb2db0c98e48d49cfde689aec51abf5.zip
I believe I have finalized export/collection support. I still want to go through all of the code and s/collectable/exported/g (thanks to womble for that term).
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1193 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/language/scope.rb')
-rwxr-xr-xtest/language/scope.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/test/language/scope.rb b/test/language/scope.rb
index c980e5055..9418a93b1 100755
--- a/test/language/scope.rb
+++ b/test/language/scope.rb
@@ -722,7 +722,8 @@ class TestScope < Test::Unit::TestCase
end
# Verify that we can both store and collect an object in the same
- # run.
+ # run, whether it's in the same scope as a collection or a different
+ # scope.
def test_storeandcollect
Puppet[:storeconfigs] = true
Puppet::Rails.clear
@@ -731,11 +732,12 @@ class TestScope < Test::Unit::TestCase
children = []
file = tempfile()
File.open(file, "w") { |f|
- #f.puts "@file { \"#{file}\": mode => 644 }
-#file <||>"
f.puts "
+class yay {
+ @host { myhost: ip => \"192.168.0.2\" }
+}
+include yay
@host { puppet: ip => \"192.168.0.3\" }
-
host <||>"
}
@@ -748,11 +750,19 @@ host <||>"
)
}
+ objects = nil
+ # We run it twice because we want to make sure there's no conflict
+ # if we pull it up from the database.
2.times { |i|
- objects = nil
assert_nothing_raised {
objects = interp.run("localhost", {})
}
+
+ flat = objects.flatten
+
+ %w{puppet myhost}.each do |name|
+ assert(flat.find{|o| o.name == name }, "Did not find #{name}")
+ end
}
end