diff options
| author | Luke Kanies <luke@madstop.com> | 2007-08-26 21:54:17 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-08-26 21:54:17 -0500 |
| commit | 11081ce8864dca2bc92d8c9f825c3fe7f96333f4 (patch) | |
| tree | 89bc049324cd3d20bcb05b55e6c267e50b82aec9 /test/network/handler | |
| parent | 9ea8e6cc8772053548d3438393dd1ead986ed719 (diff) | |
| download | puppet-11081ce8864dca2bc92d8c9f825c3fe7f96333f4.tar.gz puppet-11081ce8864dca2bc92d8c9f825c3fe7f96333f4.tar.xz puppet-11081ce8864dca2bc92d8c9f825c3fe7f96333f4.zip | |
Multiple environment support now works, and I have even tested it in real life. This commit is mostly a bug-fix commit, resulting from the difference between real-life testing and unit testing.
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, |
