Stubbed sleep to make it retry and fail faster

raised an AuthenticationFailed (to emulate a more
likely failure)

Reviewed-by: Jeff McCune

Signed-off-by: Dan Bode <d...@puppetlabs.com>
---
 spec/unit/puppet/cloudpack_spec.rb |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/spec/unit/puppet/cloudpack_spec.rb 
b/spec/unit/puppet/cloudpack_spec.rb
index f33dc06..1374105 100644
--- a/spec/unit/puppet/cloudpack_spec.rb
+++ b/spec/unit/puppet/cloudpack_spec.rb
@@ -128,8 +128,9 @@ describe Puppet::CloudPack do
         end
         it 'Exceptions eventually cause a failure' do
           Fog::SSH.expects(:new).with('server', 'root', {:key_data => 
['FOO']}).returns(@ssh_mock)
-          @ssh_mock.stubs(:run).with do |var| raise(Exception, 'fails') end
-          expect { subject.ssh_connect('server', 'root', @keyfile.path) 
}.should raise_error
+          subject.stubs(:sleep)
+          @ssh_mock.stubs(:run).with do |var| 
raise(Net::SSH::AuthenticationFailed, 'fails') end
+          expect { subject.ssh_connect('server', 'root', @keyfile.path) 
}.should raise_error(Puppet::Error)
         end
       end
       describe '#upload_payloads' do
-- 
1.7.5.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to