summaryrefslogtreecommitdiffstats
path: root/test/language
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-12 10:09:05 -0600
committerLuke Kanies <luke@madstop.com>2007-11-12 10:09:05 -0600
commit47a26054fea97641aebb3906ca7416a982f4c0d5 (patch)
tree5ce81198f1789c2194c2f6f3609badfb77e76f2b /test/language
parenta4e8f1ca2cc6c1257e4dae0f32e24ff71aa94eea (diff)
downloadpuppet-47a26054fea97641aebb3906ca7416a982f4c0d5.tar.gz
puppet-47a26054fea97641aebb3906ca7416a982f4c0d5.tar.xz
puppet-47a26054fea97641aebb3906ca7416a982f4c0d5.zip
Changing the 'main' class to no longer be lazy-evaluated.
It was getting evaluated after node classes, which caused even stranger ordering issues.
Diffstat (limited to 'test/language')
-rwxr-xr-xtest/language/compile.rb13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/language/compile.rb b/test/language/compile.rb
index 380da3da5..f5d9cb7d9 100755
--- a/test/language/compile.rb
+++ b/test/language/compile.rb
@@ -174,15 +174,18 @@ class TestCompile < Test::Unit::TestCase
# "".
def test_evaluate_main
compile = mkcompile
- main = mock 'main_class'
- compile.topscope.expects(:source=).with(main)
- @parser.expects(:findclass).with("", "").returns(main)
+ main_class = mock 'main_class'
+ compile.topscope.expects(:source=).with(main_class)
+ @parser.expects(:findclass).with("", "").returns(main_class)
+
+ main_resource = mock 'main resource'
+ Puppet::Parser::Resource.expects(:new).with { |args| args[:title] == :main }.returns(main_resource)
+
+ main_resource.expects(:evaluate)
assert_nothing_raised("Could not call evaluate_main") do
compile.send(:evaluate_main)
end
-
- assert(compile.resources.find { |r| r.to_s == "Class[main]" }, "Did not create a 'main' resource")
end
# Make sure we either don't look for nodes, or that we find and evaluate the right object.