diff options
| author | Luke Kanies <luke@madstop.com> | 2007-08-15 16:56:05 -0500 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-08-15 16:56:05 -0500 |
| commit | 297dabb63744f8ad468ee4bf5caa54a75754ceee (patch) | |
| tree | 476b1d49ca73c7e4d898dc5f5b4397a80825685c /test/network | |
| parent | 901ae687eb75885c5b717b03f2d6667f5ed8ffb5 (diff) | |
| download | puppet-297dabb63744f8ad468ee4bf5caa54a75754ceee.tar.gz puppet-297dabb63744f8ad468ee4bf5caa54a75754ceee.tar.xz puppet-297dabb63744f8ad468ee4bf5caa54a75754ceee.zip | |
Refactoring a small part of the interface between the configuration handler and the interpreter.
Diffstat (limited to 'test/network')
| -rwxr-xr-x | test/network/handler/configuration.rb | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/test/network/handler/configuration.rb b/test/network/handler/configuration.rb index 7a505f5eb..525db5e6a 100755 --- a/test/network/handler/configuration.rb +++ b/test/network/handler/configuration.rb @@ -143,7 +143,7 @@ class TestHandlerConfiguration < Test::Unit::TestCase end # Check that we're storing the node freshness into the rails db. Hackilicious. - def test_update_node_freshness + def test_update_node_check # This is stupid. config = Config.new node = Object.new @@ -160,8 +160,30 @@ class TestHandlerConfiguration < Test::Unit::TestCase Puppet::Rails.expects(:connect) Puppet::Rails::Host.expects(:find_or_create_by_name).with(:hostname).returns(host) - config.send(:update_node_freshness, node) + config.send(:update_node_check, node) + end + def test_version + # First try the case where we can't look up the node + config = Config.new + handler = Object.new + handler.expects(:details).with(:client).returns(false) + config.expects(:node_handler).returns(handler) + interp = Object.new + interp.expects(:configuration_version).returns(:version) + config.expects(:interpreter).returns(interp) + assert_equal(:version, config.version(:client), "Did not return configuration version") + # And then when we find the node. + config = Config.new + node = Object.new + handler = Object.new + handler.expects(:details).with(:client).returns(node) + config.expects(:update_node_check).with(node) + config.expects(:node_handler).returns(handler) + interp = Object.new + interp.expects(:configuration_version).returns(:version) + config.expects(:interpreter).returns(interp) + assert_equal(:version, config.version(:client), "Did not return configuration version") end end |
