diff options
| author | Luke Kanies <luke@madstop.com> | 2007-09-03 19:38:15 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-09-03 19:38:15 -0500 |
| commit | 0faf76ee187c7fa7c67a7fb7e7c345897006b7d8 (patch) | |
| tree | 21b680c617e869b11579172ab9aac33518db68da /test/language/ast | |
| parent | 9d70b9746c09f648efd6a315b3ea088da38ecd1e (diff) | |
| download | puppet-0faf76ee187c7fa7c67a7fb7e7c345897006b7d8.tar.gz puppet-0faf76ee187c7fa7c67a7fb7e7c345897006b7d8.tar.xz puppet-0faf76ee187c7fa7c67a7fb7e7c345897006b7d8.zip | |
More refactoring. I have removed a few more extraneous methods from Scope, mostly just pointing directly to the compile, and I have begun (but commented out) the move to having resources to model each of the classes and nodes, in addition to the definitions. This will, again, enable a real Configuration object, and it will enable class versioning and similar features.
Diffstat (limited to 'test/language/ast')
| -rwxr-xr-x | test/language/ast/definition.rb | 8 | ||||
| -rwxr-xr-x | test/language/ast/hostclass.rb | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/test/language/ast/definition.rb b/test/language/ast/definition.rb index 5a2e6ffea..51948b01f 100755 --- a/test/language/ast/definition.rb +++ b/test/language/ast/definition.rb @@ -110,10 +110,6 @@ class TestASTDefinition < Test::Unit::TestCase # inside the loop so the subscope expectations work. klass = parser.newdefine "yayness%s" % i - subscope = klass.subscope(scope, "yayness%s" % i) - - klass.expects(:subscope).returns(subscope) - resource = stub 'resource', :title => hash[:title], :name => hash[:name] || hash[:title], @@ -122,6 +118,10 @@ class TestASTDefinition < Test::Unit::TestCase :exported => false, :virtual => false + subscope = klass.subscope(scope, resource) + + klass.expects(:subscope).returns(subscope) + if hash[:name] resource.stubs(:to_hash).returns({:name => hash[:name]}) end diff --git a/test/language/ast/hostclass.rb b/test/language/ast/hostclass.rb index 62483730b..c88152913 100755 --- a/test/language/ast/hostclass.rb +++ b/test/language/ast/hostclass.rb @@ -36,7 +36,7 @@ class TestASTHostClass < Test::Unit::TestCase klass.evaluate(:scope => scope) end - assert(scope.class_scope(klass), "Class was not considered evaluated") + assert(scope.compile.class_scope(klass), "Class was not considered evaluated") tmp = scope.findresource("File[/tmp]") assert(tmp, "Could not find file /tmp") @@ -76,8 +76,8 @@ class TestASTHostClass < Test::Unit::TestCase moresub.evaluate(:scope => scope) end - assert(scope.class_scope(newbase), "Did not eval newbase") - assert(scope.class_scope(newsub), "Did not eval newsub") + assert(scope.compile.class_scope(newbase), "Did not eval newbase") + assert(scope.compile.class_scope(newsub), "Did not eval newsub") yay = scope.findresource("File[/tmp/yay]") assert(yay, "Did not find file /tmp/yay") @@ -141,14 +141,14 @@ class TestASTHostClass < Test::Unit::TestCase ret = nil assert_nothing_raised do - ret = scope.compile.evaluate_classes(["sub"], source) + ret = scope.compile.evaluate_classes(["sub"], scope) end - subscope = scope.class_scope(scope.findclass("sub")) + subscope = scope.compile.class_scope(scope.findclass("sub")) assert(subscope, "could not find sub scope") - mscope = scope.class_scope(scope.findclass("middle")) + mscope = scope.compile.class_scope(scope.findclass("middle")) assert(mscope, "could not find middle scope") - pscope = scope.class_scope(scope.findclass("base")) + pscope = scope.compile.class_scope(scope.findclass("base")) assert(pscope, "could not find parent scope") assert(pscope == mscope.parent, "parent scope of middle was not set correctly") |
