summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklós Fazekas <mfazekas@szemafor.com>2020-02-06 10:39:26 +0100
committerMiklos Fazekas <mfazekas@szemafor.com>2020-02-06 12:11:25 +0100
commit357821f55fa87284f415b1f712e94d6120277d3c (patch)
tree1ae22bc77070c18c692d50980a7e5542920de7d7
parent5ac22e3f214e38cd9bb196e4e6713fce861c1a8b (diff)
downloadnet-ssh-357821f55fa87284f415b1f712e94d6120277d3c.tar.gz
Use latest mocha and fix incompat
-rw-r--r--net-ssh.gemspec2
-rw-r--r--test/connection/test_session.rb14
2 files changed, 8 insertions, 8 deletions
diff --git a/net-ssh.gemspec b/net-ssh.gemspec
index ef40cb9..df564ed 100644
--- a/net-ssh.gemspec
+++ b/net-ssh.gemspec
@@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "bundler", ">= 1.17"
spec.add_development_dependency "minitest", "~> 5.10"
- spec.add_development_dependency "mocha", ">= 1.2.1"
+ spec.add_development_dependency "mocha", "~> 1.11.2"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rubocop", "~> 0.74.0"
end
diff --git a/test/connection/test_session.rb b/test/connection/test_session.rb
index 486cc63..91e3ea9 100644
--- a/test/connection/test_session.rb
+++ b/test/connection/test_session.rb
@@ -311,15 +311,15 @@ module Connection
end
def test_channel_close_packet_should_be_routed_to_corresponding_channel_and_channel_should_be_closed_and_removed
- session.channels[14] = stub("channel") do
+ session.channels[14] = stub("channel").tap do |channel|
# this simulates the case where we closed the channel first, sent
# CHANNEL_CLOSE to server and are waiting for server's response.
- expects(:local_closed?).returns(true)
- expects(:do_close)
- expects(:close).with
- expects(:remote_closed!).with
- expects(:remote_closed?).with.returns(true)
- expects(:local_id).returns(14)
+ channel.expects(:local_closed?).returns(true)
+ channel.expects(:do_close)
+ channel.expects(:close).with
+ channel.expects(:remote_closed!).with.at_least_once
+ channel.expects(:remote_closed?).with.returns(true)
+ channel.expects(:local_id).returns(14)
end
transport.return(CHANNEL_CLOSE, :long, 14)