summaryrefslogtreecommitdiff
path: root/test/authentication/methods/test_keyboard_interactive.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/authentication/methods/test_keyboard_interactive.rb')
-rw-r--r--test/authentication/methods/test_keyboard_interactive.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/authentication/methods/test_keyboard_interactive.rb b/test/authentication/methods/test_keyboard_interactive.rb
index 76d5272..ebe9c16 100644
--- a/test/authentication/methods/test_keyboard_interactive.rb
+++ b/test/authentication/methods/test_keyboard_interactive.rb
@@ -15,7 +15,7 @@ module Authentication
end
def test_authenticate_should_raise_if_keyboard_interactive_disallowed
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
assert_equal "jamis", packet.read_string
assert_equal "ssh-connection", packet.read_string
@@ -34,10 +34,10 @@ module Authentication
def test_authenticate_should_be_false_if_given_password_is_not_accepted
reset_subject(non_interactive: true)
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
t.return(USERAUTH_INFO_REQUEST, :string, "", :string, "", :string, "", :long, 1, :string, "Password:", :bool, false)
- t.expect do |t2,packet2|
+ t.expect do |t2, packet2|
assert_equal USERAUTH_INFO_RESPONSE, packet2.type
assert_equal 1, packet2.read_long
assert_equal "the-password", packet2.read_string
@@ -49,10 +49,10 @@ module Authentication
end
def test_authenticate_should_be_true_if_given_password_is_accepted
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
t.return(USERAUTH_INFO_REQUEST, :string, "", :string, "", :string, "", :long, 1, :string, "Password:", :bool, false)
- t.expect do |t2,packet2|
+ t.expect do |t2, packet2|
assert_equal USERAUTH_INFO_RESPONSE, packet2.type
t2.return(USERAUTH_SUCCESS)
end
@@ -62,10 +62,10 @@ module Authentication
end
def test_authenticate_should_duplicate_password_as_needed_to_fill_request
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
t.return(USERAUTH_INFO_REQUEST, :string, "", :string, "", :string, "", :long, 2, :string, "Password:", :bool, false, :string, "Again:", :bool, false)
- t.expect do |t2,packet2|
+ t.expect do |t2, packet2|
assert_equal USERAUTH_INFO_RESPONSE, packet2.type
assert_equal 2, packet2.read_long
assert_equal "the-password", packet2.read_string
@@ -79,10 +79,10 @@ module Authentication
def test_authenticate_should_not_prompt_for_input_when_in_non_interactive_mode
reset_subject(non_interactive: true)
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
t.return(USERAUTH_INFO_REQUEST, :string, "", :string, "", :string, "", :long, 2, :string, "Name:", :bool, true, :string, "Password:", :bool, false)
- t.expect do |t2,packet2|
+ t.expect do |t2, packet2|
assert_equal USERAUTH_INFO_RESPONSE, packet2.type
assert_equal 2, packet2.read_long
assert_equal "", packet2.read_string
@@ -100,10 +100,10 @@ module Authentication
prompt.expects(:_ask).with("Password:", anything, false).returns("password")
reset_subject(password_prompt: prompt)
- transport.expect do |t,packet|
+ transport.expect do |t, packet|
assert_equal USERAUTH_REQUEST, packet.type
t.return(USERAUTH_INFO_REQUEST, :string, "", :string, "", :string, "", :long, 2, :string, "Name:", :bool, true, :string, "Password:", :bool, false)
- t.expect do |t2,packet2|
+ t.expect do |t2, packet2|
assert_equal USERAUTH_INFO_RESPONSE, packet2.type
assert_equal 2, packet2.read_long
assert_equal "name", packet2.read_string
@@ -117,7 +117,7 @@ module Authentication
private
- def subject(options={})
+ def subject(options = {})
@subject ||= Net::SSH::Authentication::Methods::KeyboardInteractive.new(session(options), options)
end