summaryrefslogtreecommitdiffstats
path: root/test/network/handler
diff options
context:
space:
mode:
authorPaul Berry <paul@puppetlabs.com>2010-11-30 14:43:16 -0800
committerPaul Berry <paul@puppetlabs.com>2010-11-30 14:43:16 -0800
commit701021f97870b4b0be07440b30a5c53faaf39933 (patch)
tree2d7273c61a3aa21d4e475f63952450a0376a6b86 /test/network/handler
parent29a68730e4157a780f568529fbf32c9907f48731 (diff)
parent0747b58bfef9c6bb5f1f9ac1eb6a7b3955dac2af (diff)
downloadpuppet-701021f97870b4b0be07440b30a5c53faaf39933.tar.gz
puppet-701021f97870b4b0be07440b30a5c53faaf39933.tar.xz
puppet-701021f97870b4b0be07440b30a5c53faaf39933.zip
Merge branch 'maint/next/remove_save_delegation' into next
* maint/next/remove_save_delegation: Maint: Modified uses of indirector.save to call the indirection directly. Maint: Modified tests of indirector.save to call the indirection directly. Maint: Add a default value for key in Facts::NodeExpirer#save Maint: Moved auto-signing logic into an indirector extension Maint: Swap the order of arguments to Indirection#save
Diffstat (limited to 'test/network/handler')
-rwxr-xr-xtest/network/handler/master.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/network/handler/master.rb b/test/network/handler/master.rb
index 018f6904b..f4bad7037 100755
--- a/test/network/handler/master.rb
+++ b/test/network/handler/master.rb
@@ -32,15 +32,17 @@ class TestMaster < Test::Unit::TestCase
def test_hostname_is_used_if_client_is_missing
@master.expects(:decode_facts).returns("hostname" => "yay")
- Puppet::Node::Facts.expects(:new).with { |name, facts| name == "yay" }.returns(stub('facts', :save => nil))
+ facts = Puppet::Node::Facts.new("the_facts")
+ Puppet::Node::Facts.indirection.stubs(:save).with(facts)
+ Puppet::Node::Facts.expects(:new).with { |name, facts| name == "yay" }.returns(facts)
@master.getconfig("facts")
end
def test_facts_are_saved
- facts = mock('facts')
+ facts = Puppet::Node::Facts.new("the_facts")
Puppet::Node::Facts.expects(:new).returns(facts)
- facts.expects(:save)
+ Puppet::Node::Facts.indirection.expects(:save).with(facts)
@master.stubs(:decode_facts)
@@ -48,7 +50,8 @@ class TestMaster < Test::Unit::TestCase
end
def test_catalog_is_used_for_compiling
- facts = stub('facts', :save => nil)
+ facts = Puppet::Node::Facts.new("the_facts")
+ Puppet::Node::Facts.indirection.stubs(:save).with(facts)
Puppet::Node::Facts.stubs(:new).returns(facts)
@master.stubs(:decode_facts)
@@ -61,8 +64,9 @@ end
class TestMasterFormats < Test::Unit::TestCase
def setup
- @facts = stub('facts', :save => nil)
+ @facts = Puppet::Node::Facts.new("the_facts")
Puppet::Node::Facts.stubs(:new).returns(@facts)
+ Puppet::Node::Facts.indirection.stubs(:save)
@master = Puppet::Network::Handler.master.new(:Code => "")
@master.stubs(:decode_facts)