summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-28 23:58:04 -0600
committerJames Turnbull <james@lovedthanlost.net>2008-12-01 12:55:44 +1100
commit0171e25ec457e9e9d078aabbea491bbcd03448bf (patch)
tree293ae4ad1fd4750ef704b9f2a685471c93d909c5 /spec/unit
parent607958cb7fe178596930b1506b69807dc78d111b (diff)
downloadpuppet-0171e25ec457e9e9d078aabbea491bbcd03448bf.tar.gz
puppet-0171e25ec457e9e9d078aabbea491bbcd03448bf.tar.xz
puppet-0171e25ec457e9e9d078aabbea491bbcd03448bf.zip
Fixing #1749 - Splay now hopefully behaves "better" for small values.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit')
-rwxr-xr-xspec/unit/network/client/master.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/unit/network/client/master.rb b/spec/unit/network/client/master.rb
index f55ba316c..050088707 100755
--- a/spec/unit/network/client/master.rb
+++ b/spec/unit/network/client/master.rb
@@ -411,29 +411,29 @@ describe Puppet::Network::Client::Master, " when using the cached catalog" do
Puppet.stubs(:[]).with(:splaylimit).returns(42)
end
- it "should sleep for a random time" do
- @client.expects(:rand).with(42).returns(42)
- @client.expects(:sleep).with(42)
+ it "should sleep for a random time plus 1" do
+ @client.expects(:rand).with(43).returns(43)
+ @client.expects(:sleep).with(43)
@client.send(:splay)
end
it "should inform that it is splayed" do
- @client.stubs(:rand).with(42).returns(42)
- @client.stubs(:sleep).with(42)
+ @client.stubs(:rand).with(43).returns(43)
+ @client.stubs(:sleep).with(43)
Puppet.expects(:info)
@client.send(:splay)
end
it "should set splay = true" do
- @client.stubs(:rand).with(42).returns(42)
- @client.stubs(:sleep).with(42)
+ @client.stubs(:rand).returns(43)
+ @client.stubs(:sleep)
@client.send(:splay)
@client.send(:splayed?).should == true
end
it "should do nothing if already splayed" do
- @client.stubs(:rand).with(42).returns(42).at_most_once
- @client.stubs(:sleep).with(42).at_most_once
+ @client.stubs(:rand).returns(43).at_most_once
+ @client.stubs(:sleep).at_most_once
@client.send(:splay)
@client.send(:splay)
end