1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
Description: tests: fix Mocha 3+ strict keyword-argument matching in expectations
With Mocha >= 3.0 (and Ruby 3+ keyword separation) an expectation written as
`.with(foo: bar)` is now treated as a keyword argument, while the real code
passes a positional Hash `{foo: bar}`.
Author: Simon Quigley <tsimonq2@debian.org>
Origin: vendor
Forwarded: not-needed
Last-Update: 2026-02-22
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/test/channel_test.rb
+++ b/test/channel_test.rb
@@ -31,8 +31,8 @@ class ChannelTest < Minitest::Test
def test_request_pty_should_delegate_to_component_channels
c1, c2, results = mock('channel'), mock('channel'), []
- c1.expects(:request_pty).with(:foo => 5).yields(c1)
- c2.expects(:request_pty).with(:foo => 5).yields(c2)
+ c1.expects(:request_pty).with({foo: 5}).yields(c1)
+ c2.expects(:request_pty).with({foo: 5}).yields(c2)
channel = Net::SSH::Multi::Channel.new(mock('session'), [c1, c2])
assert_equal channel, channel.request_pty(:foo => 5) { |c| results << c }
assert_equal [c1, c2], results
--- a/test/session_test.rb
+++ b/test/session_test.rb
@@ -38,7 +38,7 @@ class SessionTest < Minitest::Test
end
def test_via_should_instantiate_and_set_default_gateway
- Net::SSH::Gateway.expects(:new).with('host', 'user', :a => :b).returns(:gateway)
+ Net::SSH::Gateway.expects(:new).with('host', 'user', {a: :b}).returns(:gateway)
assert_equal @session, @session.via('host', 'user', :a => :b)
assert_equal :gateway, @session.default_gateway
end
|