net-ssh / net-scp

Pure Ruby implementation of the SCP protocol
http://github.com/delano/net-scp
MIT License
154 stars 63 forks source link

tests fail on ruby2.3 #36

Closed oz123 closed 5 months ago

oz123 commented 6 years ago
ruby23 -Ilib:test test/test_all.rb
Loaded suite test/test_all
Started
..E
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:214:in `test_download_directory_should_create_directory_and_files_locally'
F
========================================================================================================================================================================
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit.rb:502:in `block (2 levels) in <top (required)>'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/autorunner.rb:62:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/autorunner.rb:434:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/autorunner.rb:491:in `change_work_directory'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/autorunner.rb:435:in `block in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnerutilities.rb:24:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunner.rb:25:in `start'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunner.rb:40:in `start_mediator'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:39:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:39:in `catch'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:41:in `block in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:102:in `with_listener'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:45:in `block (2 levels) in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:67:in `run_suite'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:53:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:53:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:53:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testsuite.rb:124:in `run_test'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:496:in `run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:496:in `catch'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:497:in `block in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/fixture.rb:286:in `run_setup'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/fixture.rb:251:in `run_fixture'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/fixture.rb:270:in `block in create_fixtures_runner'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/fixture.rb:270:in `block in create_fixtures_runner'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/fixture.rb:270:in `block in create_fixtures_runner'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:498:in `block (2 levels) in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:504:in `rescue in block (2 levels) in run'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:798:in `handle_exception'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:798:in `each'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testcase.rb:802:in `block in handle_exception'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/error.rb:93:in `handle_all_exception'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/error.rb:121:in `add_error'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/error.rb:131:in `add_error'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/testresult.rb:128:in `notify_fault'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `notify_listeners'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `each'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `block in notify_listeners'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/testrunnermediator.rb:98:in `block in with_listener'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `notify_listeners'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `each'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/util/observable.rb:78:in `block in notify_listeners'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:101:in `add_fault'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:485:in `output_progress_in_detail'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:200:in `output_fault_in_detail'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:235:in `output_fault_backtrace'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:235:in `each_with_index'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:235:in `each'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:240:in `block in output_fault_backtrace'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/ui/console/testrunner.rb:246:in `output_code_snippet'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/code-snippet-fetcher.rb:10:in `fetch'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/code-snippet-fetcher.rb:22:in `source'
/usr/lib64/ruby/gems/2.3.0/gems/test-unit-3.2.7/lib/test/unit/code-snippet-fetcher.rb:29:in `read_source'
Failure: test_download_directory_should_create_directory_and_files_locally(TestDownload):
  unexpected invocation: File.open("/home/oznt/Software/net-scp/test/test_download.rb")
  satisfied expectations:
  - allowed any number of times, not yet invoked: Dir.entries("/path/to/local/remote/sub")
  - allowed any number of times, not yet invoked: Dir.mkdir()
  - allowed any number of times, not yet invoked: Dir.entries("/path/to/local/remote")
  - allowed any number of times, not yet invoked: Dir.mkdir()
  - allowed any number of times, not yet invoked: Dir.entries("/path/to/local")
  - allowed any number of times, not yet invoked: Dir.mkdir()
  - allowed any number of times, not yet invoked: File.new("/path/to/local/remote/sub/remote.txt", "wb", 438)
  - allowed any number of times, not yet invoked: File.open("/path/to/local/remote/sub/remote.txt", "rb")
  - allowed any number of times, not yet invoked: File.file?("/path/to/local/remote/sub/remote.txt")
  - allowed any number of times, not yet invoked: File.directory?("/path/to/local/remote/sub/remote.txt")
  - allowed any number of times, not yet invoked: File.stat("/path/to/local/remote/sub/remote.txt")
  - allowed any number of times, not yet invoked: File.file?("/path/to/local/remote/sub")
  - allowed any number of times, not yet invoked: File.directory?("/path/to/local/remote/sub")
  - allowed any number of times, not yet invoked: File.stat("/path/to/local/remote/sub")
  - allowed any number of times, not yet invoked: File.file?("/path/to/local/remote")
  - allowed any number of times, not yet invoked: File.directory?("/path/to/local/remote")
  - allowed any number of times, not yet invoked: File.stat("/path/to/local/remote")
  - allowed any number of times, not yet invoked: File.file?("/path/to/local")
  - allowed any number of times, not yet invoked: File.directory?("/path/to/local")
  - allowed any number of times, not yet invoked: File.stat("/path/to/local")
========================================================================================================================================================================
F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:188:in `test_download_directory_should_raise_error_if_local_exists_and_is_not_directory'
     185:       channel.sends_ok
     186:     end
     187: 
  => 188:     e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote", "/path/to/local", :recursive => true) }
     189:     assert_match(/exists and is not a directory/, e.message)
     190:   end
     191: 

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_download_directory_should_raise_error_if_local_exists_and_is_not_directory(TestDownload)
========================================================================================================================================================================
F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:158:in `test_download_directory_without_recursive_should_raise_error'
     155:       channel.gets_data "D0755 0 remote\n"
     156:     end
     157: 
  => 158:     assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote") }
     159:   end
     160: 
     161:   def test_download_should_raise_error_if_gets_not_ok

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_download_directory_without_recursive_should_raise_error(TestDownload)
========================================================================================================================================================================
.....F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:119:in `test_download_io_with_recursive_should_raise_error'
     116: 
     117:   def test_download_io_with_recursive_should_raise_error
     118:     expect_scp_session "-f -r /path/to/remote.txt"
  => 119:     assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", StringIO.new, :recursive => true) }
     120:   end
     121: 
     122:   def test_download_io_with_preserve_should_ignore_preserve

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_download_io_with_recursive_should_raise_error(TestDownload)
========================================================================================================================================================================
F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:171:in `test_download_should_raise_error_if_gets_not_ok'
     168:       channel.gets_data "\1"
     169:     end
     170: 
  => 171:     e = assert_raises(Net::SCP::Error) { scp.download!("/path/to/remote.txt", "/path/to/local.txt") }
     172:     assert_equal("\1", e.message)
     173:   end
     174: 

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_download_should_raise_error_if_gets_not_ok(TestDownload)
========================================================================================================================================================================
F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_download.rb:73:in `test_download_with_error_should_respond_with_error_text'
     70:     end
     71: 
     72:     error = nil
  => 73:     assert_scripted do
     74:       begin
     75:         scp.download!("/path/to/remote.txt")
     76:       rescue
/usr/lib64/ruby/gems/2.3.0/gems/net-ssh-4.2.0/lib/net/ssh/test.rb:88:in `assert_scripted'
Failure: test_download_with_error_should_respond_with_error_text(TestDownload):
  there should not be any remaining scripted events, but there are still 1 pending.
  <false> is not true.
========================================================================================================================================================================
........F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_upload.rb:159:in `test_upload_directory_without_recursive_should_error'
     156:       channel.gets_ok
     157:     end
     158: 
  => 159:     assert_raises(Net::SCP::Error) { scp.upload!("/path/to/local", "/path/to/remote") }
     160:   end
     161: 
     162:   def test_upload_empty_directory_should_create_directory_and_finish

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_upload_directory_without_recursive_should_error(TestUpload)
========================================================================================================================================================================
...........F
========================================================================================================================================================================
/home/oznt/Software/net-scp/test/test_upload.rb:277:in `test_upload_should_raise_error_if_gets_not_ok'
     274:       channel.gets_data "\1"
     275:     end
     276: 
  => 277:     e = assert_raises(Net::SCP::Error) { scp.upload!("/path/to/local.txt", "/path/to/remote.txt") }
     278:     assert_equal("\1", e.message)
     279:   end
     280: end

<Net::SCP::Error> expected but was
<TypeError(<no implicit conversion of Net::SSH::Test::Socket into IO>)>

diff:
?                                      Net::SCP::Err    or             
? TypeError(<no implicit conversion of       SH  Test::S cket into IO>)
Failure: test_upload_should_raise_error_if_gets_not_ok(TestUpload)
========================================================================================================================================================================

Finished in 0.294052809 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
34 tests, 61 assertions, 8 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
76.4706% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
115.63 tests/s, 207.45 assertions/s
robertcheramy commented 5 months ago

As ruby 2.3 is not supported anymore, I think this issue can be closed.

oz123 commented 5 months ago

Yes, true.