summaryrefslogtreecommitdiff
path: root/dev-ruby/net-scp/files/net-scp-1.2.1-raise-correct-errors-net-ssh-4.0-compat.patch
blob: 3431f06b7cff0b43527e9312023d46e991f99286 (plain)
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
--- test/test_download.rb	2018-01-22 01:47:38.932010818 +0100
+++ test/test_download.rb.1	2018-01-22 01:49:14.552011046 +0100
@@ -205,9 +205,11 @@
       channel.sends_ok
       channel.gets_data "\1"
     end
-
-    e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
-    assert_equal("\1", e.message)
+    
+    Net::SSH::Test::Extensions::IO.with_test_extension do
+      e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
+      assert_equal("\1", e.message)
+    end
   end
 
   def test_download_directory_should_raise_error_if_local_exists_and_is_not_directory
@@ -223,8 +225,10 @@
       channel.sends_ok
     end
     
-    e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
-    assert_match(/exists and is not a directory/, e.message)
+    Net::SSH::Test::Extensions::IO.with_test_extension do
+      e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
+      assert_match(/exists and is not a directory/, e.message)
+    end
   end
 
   def test_download_directory_should_create_directory_and_files_locally