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

Fix issue #72: rake test fails with mocha > 2.1.0 #74

Open tibob opened 3 months ago

tibob commented 3 months ago

Using Mocha::Mock.new is not supported in mocha, and mock() does not work in a subclass of Test::Unit::TestCase As we just need a stub for File:Statt an no mock, we just create an Object (instead of a mock) and stub it.

I've separated the pull request in two commits:

Fixing the rubocop warnings of test/common.rb makes the PR somehow difficult to read. The fix itself is pretty small:

- stat = Mocha::Mock.new('file::stat')
+ # Stub for File::Stat
+ stat = Object.new

I've proposed this fix as I think you need the unit tests to work in order to make a new release. Would it be possible to release a new version of Net::SCP in the near future? I'd love see issue https://github.com/ytti/oxidized/issues/1802 being closed ;-) Is there something I can do to help producing a new release?

This PR fixes #72