diff options
Diffstat (limited to 'test/network/handler')
| -rwxr-xr-x | test/network/handler/configuration.rb | 22 | ||||
| -rwxr-xr-x | test/network/handler/node.rb | 2 |
2 files changed, 14 insertions, 10 deletions
diff --git a/test/network/handler/configuration.rb b/test/network/handler/configuration.rb index a34952208..072fdc053 100755 --- a/test/network/handler/configuration.rb +++ b/test/network/handler/configuration.rb @@ -52,7 +52,7 @@ class TestHandlerConfiguration < Test::Unit::TestCase args = {} # Try it first with defaults. - Puppet::Parser::Interpreter.expects(:new).with(:Local => config.local?, :Manifest => Puppet[:manifest]).returns(:interp) + Puppet::Parser::Interpreter.expects(:new).with(:Local => config.local?).returns(:interp) assert_equal(:interp, config.send(:create_interpreter, args), "Did not return the interpreter") # Now reset it and make sure a specified manifest passes through @@ -93,10 +93,12 @@ class TestHandlerConfiguration < Test::Unit::TestCase config = Config.new # First do a local - node = Object.new - node.expects(:name).returns(:mynode) + node = mock 'node' + node.stubs(:name).returns(:mynode) + node.stubs(:environment).returns(:myenv) - interp = Object.new + interp = mock 'interpreter' + interp.stubs(:environment) interp.expects(:compile).with(node).returns(:config) config.expects(:interpreter).returns(interp) @@ -105,13 +107,15 @@ class TestHandlerConfiguration < Test::Unit::TestCase assert_equal(:config, config.send(:compile, node), "Did not return config") # Now try it non-local - config = Config.new(:Local => true) - - node = Object.new - node.expects(:name).returns(:mynode) + node = mock 'node' + node.stubs(:name).returns(:mynode) + node.stubs(:environment).returns(:myenv) - interp = Object.new + interp = mock 'interpreter' + interp.stubs(:environment) interp.expects(:compile).with(node).returns(:config) + + config = Config.new(:Local => true) config.expects(:interpreter).returns(interp) assert_equal(:config, config.send(:compile, node), "Did not return config") diff --git a/test/network/handler/node.rb b/test/network/handler/node.rb index f7cbf6017..6b8ab9290 100755 --- a/test/network/handler/node.rb +++ b/test/network/handler/node.rb @@ -531,7 +531,7 @@ class LdapNodeTest < PuppetTest::TestCase end def ldaphost(name) - node = NodeDef.new(:name => name) + node = Puppet::Node.new(name) parent = nil found = false @ldap.search( "ou=hosts, dc=madstop, dc=com", 2, |
