@@ -4,26 +4,26 @@ class TestSCP < Net::SCP::TestCase
4
4
def test_start_without_block_should_return_scp_instance
5
5
ssh = stub ( 'session' , :logger => nil )
6
6
Net ::SSH . expects ( :start ) .
7
- with ( "remote.host" , "username" , :password => "foo" ) .
7
+ with ( "remote.host" , "username" , { :password => "foo" } ) .
8
8
returns ( ssh )
9
9
10
10
ssh . expects ( :close ) . never
11
- scp = Net ::SCP . start ( "remote.host" , "username" , :password => "foo" )
11
+ scp = Net ::SCP . start ( "remote.host" , "username" , { :password => "foo" } )
12
12
assert_instance_of Net ::SCP , scp
13
13
assert_equal ssh , scp . session
14
14
end
15
15
16
16
def test_start_with_block_should_yield_scp_and_close_ssh_session
17
17
ssh = stub ( 'session' , :logger => nil )
18
18
Net ::SSH . expects ( :start ) .
19
- with ( "remote.host" , "username" , :password => "foo" ) .
19
+ with ( "remote.host" , "username" , { :password => "foo" } ) .
20
20
returns ( ssh )
21
21
22
22
ssh . expects ( :loop )
23
23
ssh . expects ( :close )
24
24
25
25
yielded = false
26
- Net ::SCP . start ( "remote.host" , "username" , :password => "foo" ) do |scp |
26
+ Net ::SCP . start ( "remote.host" , "username" , { :password => "foo" } ) do |scp |
27
27
yielded = true
28
28
assert_instance_of Net ::SCP , scp
29
29
assert_equal ssh , scp . session
@@ -34,26 +34,26 @@ def test_start_with_block_should_yield_scp_and_close_ssh_session
34
34
35
35
def test_self_upload_should_instatiate_scp_and_invoke_synchronous_upload
36
36
scp = stub ( 'scp' )
37
- scp . expects ( :upload! ) . with ( "/path/to/local" , "/path/to/remote" , :recursive => true )
37
+ scp . expects ( :upload! ) . with ( "/path/to/local" , "/path/to/remote" , { :recursive => true } )
38
38
39
39
Net ::SCP . expects ( :start ) .
40
- with ( "remote.host" , "username" , :password => "foo" ) .
40
+ with ( "remote.host" , "username" , { :password => "foo" } ) .
41
41
yields ( scp )
42
42
43
43
Net ::SCP . upload! ( "remote.host" , "username" , "/path/to/local" , "/path/to/remote" ,
44
- :ssh => { :password => "foo" } , :recursive => true )
44
+ { :ssh => { :password => "foo" } , :recursive => true } )
45
45
end
46
46
47
47
def test_self_download_should_instatiate_scp_and_invoke_synchronous_download
48
48
scp = stub ( 'scp' )
49
- scp . expects ( :download! ) . with ( "/path/to/remote" , "/path/to/local" , :recursive => true ) . returns ( :result )
49
+ scp . expects ( :download! ) . with ( "/path/to/remote" , "/path/to/local" , { :recursive => true } ) . returns ( :result )
50
50
51
51
Net ::SCP . expects ( :start ) .
52
- with ( "remote.host" , "username" , :password => "foo" ) .
52
+ with ( "remote.host" , "username" , { :password => "foo" } ) .
53
53
yields ( scp )
54
54
55
55
result = Net ::SCP . download! ( "remote.host" , "username" , "/path/to/remote" , "/path/to/local" ,
56
- :ssh => { :password => "foo" } , :recursive => true )
56
+ { :ssh => { :password => "foo" } , :recursive => true } )
57
57
58
58
assert_equal :result , result
59
59
end
0 commit comments