[rspec-users] Mocking Net::SSH connections

Ashley Moran ashley.moran at patchspace.co.uk
Mon Apr 21 02:55:33 EDT 2008


On 21 Apr 2008, at 07:03, Jamie D wrote:

> Net::SSH.should_receive(:shell).and_return('something')

This should be @ssh.should_receive(:shell).and_return('something')

But actually it will need to return a mock with :sync stubbed for the  
line:
shell = session.shell.sync

Ashley

-- 
http://www.patchspace.co.uk/
http://aviewfromafar.net/





More information about the rspec-users mailing list