For what it's worth, I tried to reproduce your problem, but wasn't able to.
Specifically, the following code:
require 'net/ssh'
require 'net/ssh/shell'
def try_process
Net::SSH.start('123.123.123.123', {}) do |ssh|
end
end
describe "" do
it "" do
try_process
end
end
produced the following output:
F
Failures:
1)
Failure/Error: Net::SSH.start('123.123.123.123', {}) do |ssh|
Errno::ETIMEDOUT:
Operation timed out - connect(2)
# ./tmp/so_spec.rb:5:in `try_process'
# ./tmp/so_spec.rb:11:in `block (2 levels) in <top (required)>'
Finished in 1 minute 15.69 seconds
1 example, 1 failure
Failed examples:
rspec ./tmp/so_spec.rb:10 #
indicating that the timeout
method remained accessible within the RSpec block.
This testing was done with Ruby 2.0.0p247 and RSpec 2.14.5