Accept mode as argument in `file_write' action
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user