From d9fdd8ec2cb2db0c98e48d49cfde689aec51abf5 Mon Sep 17 00:00:00 2001 From: luke Date: Mon, 15 May 2006 18:02:16 +0000 Subject: 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 --- test/language/scope.rb | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'test/language') 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 -- cgit