Accept mode as argument in `file_write' action

This commit is contained in:
Thibault Jouan
2014-04-24 23:46:43 +00:00
parent 47412d8bce
commit 5cb6296057
6 changed files with 64 additions and 5 deletions

View File

@@ -126,7 +126,7 @@ module Producer::Core
let(:content) { 'some_content' }
it 'opens the file' do
expect(sftp_file).to receive(:open).with(path, 'w')
expect(sftp_file).to receive(:open).with(path, 'w', anything)
fs.file_write path, content
end
@@ -137,6 +137,11 @@ module Producer::Core
end
fs.file_write path, content
end
it 'accepts an optional mode argument' do
expect(sftp_file).to receive(:open).with(anything, anything, 0600)
fs.file_write path, content, 0600
end
end
end
end