Very odd... I'm using mocha 0.9.3 here, too, and the tests all pass for me.
Frankly, the Net::SSH unit tests are a mess. I hate their heavy dependence on deep mocking, but at the same time I'm not sure how else to test the library. Networking + Crypto make for a tough combination to test (for me, anyway). The only real alternative I can think of is to mock up an SSH server...which sounds even worse. - Jamis On 12/17/08 1:10 AM, deadprogrammer wrote: > I pulled the newest code for Net::SSH from github, and tried to run > the units. However two tests are not passing for me: > > 1) Failure: > test_authenticate_should_return_false_if_no_keys_can_authenticate > (Authentication::Methods::TestHostbased) > [./../lib/net/ssh/authentication/methods/hostbased.rb:41:in > `authenticate_with' > ./../lib/net/ssh/authentication/methods/hostbased.rb:18:in > `authenticate' > ./../lib/net/ssh/authentication/methods/hostbased.rb:17:in `each' > ./../lib/net/ssh/authentication/methods/hostbased.rb:17:in > `authenticate' > ./authentication/methods/test_hostbased.rb:36:in > `test_authenticate_should_return_false_if_no_keys_can_authenticate']: > unexpected invocation: #<Mock:key_manager>.sign(-----BEGIN RSA PRIVATE > KEY----- > MCsCAQACBQCe5UyZAgMBAAECBBCOcCUCAwDL/wIDAMdnAgIFswICcT8CAkJw > -----END RSA PRIVATE KEY----- > , '\000\000\000\tabcxyz1232\000\000\000\005jamis\000\000\000\016ssh- > connection\000\000\000\thostbased\000\000\000\assh-rsa\000\000\000\e > \000\000\000\assh-rsa > \000\000\000\003\001\000\001\000\000\000\005\000\236\345L > \231\000\000\000\fme.ssh.test.\000\000\000\003ron') > unsatisfied expectations: > - expected exactly once, not yet invoked: #<Mock:key_manager>.sign() > - expected exactly once, not yet invoked: #<Mock:key_manager>.sign() > satisfied expectations: > - allowed any number of times, already invoked once: > #<Mock:key_manager>.identities(any_parameters) > - allowed any number of times, already invoked once: > #<Mock:socket>.client_name(any_parameters) > - allowed any number of times, already invoked twice: #<Mock:auth- > session>.transport(any_parameters) > - allowed any number of times, already invoked once: #<Mock:auth- > session>.logger(any_parameters) > > 2) Failure: > test_authenticate_should_return_true_if_any_key_can_authenticate > (Authentication::Methods::TestHostbased) > [./../lib/net/ssh/authentication/methods/hostbased.rb:41:in > `authenticate_with' > ./../lib/net/ssh/authentication/methods/hostbased.rb:18:in > `authenticate' > ./../lib/net/ssh/authentication/methods/hostbased.rb:17:in `each' > ./../lib/net/ssh/authentication/methods/hostbased.rb:17:in > `authenticate' > ./authentication/methods/test_hostbased.rb:49:in > `test_authenticate_should_return_true_if_any_key_can_authenticate']: > unexpected invocation: #<Mock:key_manager>.sign(-----BEGIN RSA PRIVATE > KEY----- > MCsCAQACBQCe5UyZAgMBAAECBBCOcCUCAwDL/wIDAMdnAgIFswICcT8CAkJw > -----END RSA PRIVATE KEY----- > , '\000\000\000\tabcxyz1232\000\000\000\005jamis\000\000\000\016ssh- > connection\000\000\000\thostbased\000\000\000\assh-rsa\000\000\000\e > \000\000\000\assh-rsa > \000\000\000\003\001\000\001\000\000\000\005\000\236\345L > \231\000\000\000\fme.ssh.test.\000\000\000\003ron') > unsatisfied expectations: > - expected exactly once, not yet invoked: #<Mock:key_manager>.sign() > satisfied expectations: > - allowed any number of times, already invoked once: > #<Mock:key_manager>.identities(any_parameters) > - allowed any number of times, already invoked once: > #<Mock:socket>.client_name(any_parameters) > - allowed any number of times, already invoked twice: #<Mock:auth- > session>.transport(any_parameters) > - allowed any number of times, already invoked once: #<Mock:auth- > session>.logger(any_parameters) > > I had installed Mocha 0.9.3 but these two tests do not pass for me. > Anyone got any ideas? > > > --~--~---------~--~----~------------~-------~--~----~ To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/capistrano -~----------~----~----~----~------~----~------~--~---
