From fd0c5cbddec8dc53196a3b84e33e1000c3c0720f Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Mon, 11 Feb 2008 17:59:34 -0600 Subject: Changing the name of the Compile class to Compiler, since it's stupid to have a class named after a verb. --- test/language/ast.rb | 4 ++-- test/language/ast/definition.rb | 2 +- test/language/ast/node.rb | 2 +- test/language/ast/resource.rb | 2 +- test/language/ast/resource_reference.rb | 2 +- test/language/functions.rb | 26 +++++++++++++------------- test/language/parser.rb | 4 ++-- test/language/resource.rb | 4 ++-- test/language/scope.rb | 18 +++++++++--------- 9 files changed, 32 insertions(+), 32 deletions(-) (limited to 'test/language') diff --git a/test/language/ast.rb b/test/language/ast.rb index 9b8c74cfb..8c0f31aba 100755 --- a/test/language/ast.rb +++ b/test/language/ast.rb @@ -57,7 +57,7 @@ class TestAST < Test::Unit::TestCase end Puppet::Parser::Resource.expects(:new).with { |o| o.is_a?(Hash) }.returns(:override) - scope.compile.expects(:add_override).with(:override) + scope.compiler.expects(:add_override).with(:override) ret = nil assert_nothing_raised do ret = ref.evaluate scope @@ -111,7 +111,7 @@ class TestAST < Test::Unit::TestCase assert_instance_of(Puppet::Parser::Collector, ret) # Now make sure we get it back from the scope - colls = scope.compile.instance_variable_get("@collections") + colls = scope.compiler.instance_variable_get("@collections") assert_equal([ret], colls, "Did not store collector in config's collection list") end diff --git a/test/language/ast/definition.rb b/test/language/ast/definition.rb index d4e4bd185..1585c5b1d 100755 --- a/test/language/ast/definition.rb +++ b/test/language/ast/definition.rb @@ -40,7 +40,7 @@ class TestASTDefinition < Test::Unit::TestCase def test_evaluate parser = mkparser - config = mkcompile + config = mkcompiler config.send(:evaluate_main) scope = config.topscope klass = parser.newdefine "yayness", diff --git a/test/language/ast/node.rb b/test/language/ast/node.rb index df732480d..a90f05adf 100755 --- a/test/language/ast/node.rb +++ b/test/language/ast/node.rb @@ -18,7 +18,7 @@ class TestASTNode < Test::Unit::TestCase def test_node scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser # Define a base node basenode = parser.newnode "basenode", :code => AST::ASTArray.new(:children => [ diff --git a/test/language/ast/resource.rb b/test/language/ast/resource.rb index aff1dba16..97541d92f 100755 --- a/test/language/ast/resource.rb +++ b/test/language/ast/resource.rb @@ -16,7 +16,7 @@ class TestASTResource< Test::Unit::TestCase def setup super @scope = mkscope - @parser = @scope.compile.parser + @parser = @scope.compiler.parser end def newdef(type, title, params = nil) diff --git a/test/language/ast/resource_reference.rb b/test/language/ast/resource_reference.rb index 9de3391d9..1f554d90f 100755 --- a/test/language/ast/resource_reference.rb +++ b/test/language/ast/resource_reference.rb @@ -20,7 +20,7 @@ class TestASTResourceReference < Test::Unit::TestCase def setup super @scope = mkscope - @parser = @scope.compile.parser + @parser = @scope.compiler.parser end def test_evaluate diff --git a/test/language/functions.rb b/test/language/functions.rb index b8f7d4313..a5d52d7ac 100755 --- a/test/language/functions.rb +++ b/test/language/functions.rb @@ -66,7 +66,7 @@ class TestLangFunctions < Test::Unit::TestCase # Now make sure we correctly get tags. scope.resource.tag("resourcetag") assert(scope.function_tagged("resourcetag"), "tagged function did not catch resource tags") - scope.compile.catalog.tag("configtag") + scope.compiler.catalog.tag("configtag") assert(scope.function_tagged("configtag"), "tagged function did not catch catalog tags") end @@ -308,7 +308,7 @@ class TestLangFunctions < Test::Unit::TestCase def test_realize scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser # Make a definition parser.newdefine("mytype") @@ -318,7 +318,7 @@ class TestLangFunctions < Test::Unit::TestCase virtual = mkresource(:type => type, :title => title, :virtual => true, :params => {}, :scope => scope) - scope.compile.add_resource(scope, virtual) + scope.compiler.add_resource(scope, virtual) ref = Puppet::Parser::Resource::Reference.new( :type => type, :title => title, @@ -330,13 +330,13 @@ class TestLangFunctions < Test::Unit::TestCase end # Make sure it created a collection - assert_equal(1, scope.compile.collections.length, + assert_equal(1, scope.compiler.collections.length, "Did not set collection") assert_nothing_raised do - scope.compile.collections.each do |coll| coll.evaluate end + scope.compiler.collections.each do |coll| coll.evaluate end end - scope.compile.collections.clear + scope.compiler.collections.clear # Now make sure the virtual resource is no longer virtual assert(! virtual.virtual?, "Did not make virtual resource real") @@ -354,17 +354,17 @@ class TestLangFunctions < Test::Unit::TestCase end # Make sure it created a collection - assert_equal(1, scope.compile.collections.length, + assert_equal(1, scope.compiler.collections.length, "Did not set collection") # And the collection has our resource in it - assert_equal([none.to_s], scope.compile.collections[0].resources, + assert_equal([none.to_s], scope.compiler.collections[0].resources, "Did not set resources in collection") end def test_defined scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser parser.newclass("yayness") parser.newdefine("rahness") @@ -385,7 +385,7 @@ class TestLangFunctions < Test::Unit::TestCase "Multiple falses were somehow true") # Now make sure we can test resources - scope.compile.add_resource(scope, mkresource(:type => "file", :title => "/tmp/rahness", + scope.compiler.add_resource(scope, mkresource(:type => "file", :title => "/tmp/rahness", :scope => scope, :source => scope.source, :params => {:owner => "root"})) @@ -420,7 +420,7 @@ class TestLangFunctions < Test::Unit::TestCase def test_include scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser assert_raise(Puppet::ParseError, "did not throw error on missing class") do scope.function_include("nosuchclass") @@ -428,7 +428,7 @@ class TestLangFunctions < Test::Unit::TestCase parser.newclass("myclass") - scope.compile.expects(:evaluate_classes).with(%w{myclass otherclass}, scope, false).returns(%w{myclass otherclass}) + scope.compiler.expects(:evaluate_classes).with(%w{myclass otherclass}, scope, false).returns(%w{myclass otherclass}) assert_nothing_raised do scope.function_include(["myclass", "otherclass"]) @@ -480,7 +480,7 @@ class TestLangFunctions < Test::Unit::TestCase assert_equal("yay-foo\n", %x{#{command} foo}, "command did not work") scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser val = nil assert_nothing_raised("Could not call generator with no args") do diff --git a/test/language/parser.rb b/test/language/parser.rb index 3df4d0bb8..2a0e9c02d 100755 --- a/test/language/parser.rb +++ b/test/language/parser.rb @@ -45,7 +45,7 @@ class TestParser < Test::Unit::TestCase assert_raise(Puppet::ParseError, "Did not fail while parsing %s" % file) { parser.file = file ast = parser.parse - config = mkcompile(parser) + config = mkcompiler(parser) config.compile #ast.classes[""].evaluate config.topscope } @@ -868,7 +868,7 @@ file { "/tmp/yayness": def test_newclass scope = mkscope - parser = scope.compile.parser + parser = scope.compiler.parser mkcode = proc do |ary| classes = ary.collect do |string| diff --git a/test/language/resource.rb b/test/language/resource.rb index dbb1ab9f9..608e7c995 100755 --- a/test/language/resource.rb +++ b/test/language/resource.rb @@ -341,7 +341,7 @@ class TestResource < PuppetTest::TestCase {:name => "one", :title => "two"}, {:title => "three"}, ].each do |hash| - config = mkcompile parser + config = mkcompiler parser args = {:type => "yayness", :title => hash[:title], :source => klass, :scope => config.topscope} if hash[:name] @@ -388,7 +388,7 @@ class TestResource < PuppetTest::TestCase :code => resourcedef("file", varref("name"), "mode" => "644")) - config = mkcompile(parser) + config = mkcompiler(parser) res = mkresource :type => "yayness", :title => "foo", :params => {}, :scope => config.topscope res.virtual = true diff --git a/test/language/scope.rb b/test/language/scope.rb index b35687e66..9c0e583e4 100755 --- a/test/language/scope.rb +++ b/test/language/scope.rb @@ -27,7 +27,7 @@ class TestScope < Test::Unit::TestCase end def test_variables - config = mkcompile + config = mkcompiler topscope = config.topscope midscope = config.newscope(topscope) botscope = config.newscope(midscope) @@ -94,7 +94,7 @@ class TestScope < Test::Unit::TestCase classes = ["", "one", "one::two", "one::two::three"].each do |name| klass = parser.newclass(name) Puppet::Parser::Resource.new(:type => "class", :title => name, :scope => scope, :source => mock('source')).evaluate - scopes[name] = scope.compile.class_scope(klass) + scopes[name] = scope.compiler.class_scope(klass) end classes.each do |name| @@ -125,7 +125,7 @@ class TestScope < Test::Unit::TestCase end def test_setdefaults - config = mkcompile + config = mkcompiler scope = config.topscope @@ -151,7 +151,7 @@ class TestScope < Test::Unit::TestCase end def test_lookupdefaults - config = mkcompile + config = mkcompiler top = config.topscope # Make a subscope @@ -179,7 +179,7 @@ class TestScope < Test::Unit::TestCase end def test_parent - config = mkcompile + config = mkcompiler top = config.topscope # Make a subscope @@ -205,7 +205,7 @@ class TestScope < Test::Unit::TestCase %w{one one::two one::two::three}.each do |name| klass = parser.newclass(name) Puppet::Parser::Resource.new(:type => "class", :title => name, :scope => scope, :source => mock('source')).evaluate - scopes[name] = scope.compile.class_scope(klass) + scopes[name] = scope.compiler.class_scope(klass) scopes[name].setvar("test", "value-%s" % name.sub(/.+::/,'')) end @@ -287,10 +287,10 @@ class TestScope < Test::Unit::TestCase function.evaluate scope end - scope.compile.send(:evaluate_generators) + scope.compiler.send(:evaluate_generators) [myclass, otherclass].each do |klass| - assert(scope.compile.class_scope(klass), + assert(scope.compiler.class_scope(klass), "%s was not set" % klass.classname) end end @@ -332,7 +332,7 @@ class TestScope < Test::Unit::TestCase # Verify that we recursively mark as exported the results of collectable # components. def test_exportedcomponents - config = mkcompile + config = mkcompiler parser = config.parser # Create a default source -- cgit