Modify Remote::FS interface:

* Accept SFTP session in FS constructor;
* Modify Remote to build the session required by FS;
* Change TestEnvHelpers#build_remote in order to provided a test double
  as the remote FS.
This commit is contained in:
Thibault Jouan
2014-01-23 22:21:10 +00:00
parent 65c727d5da
commit f45d0b5a20
5 changed files with 18 additions and 59 deletions

View File

@@ -26,6 +26,9 @@ module TestEnvHelpers
end
def build_remote
Producer::Core::Testing::MockRemote.new('some_host.test')
fs = RSpec::Mocks::Mock.new('remote fs', __declared_as: 'Double')
remote = Producer::Core::Testing::MockRemote.new('some_host.test')
remote.define_singleton_method(:fs) { fs }
remote
end
end