Improve mkdir so that permissions will be forced:

SFTP will honor umask on server side, and new directories won't get
expected permissions. We need to explicitly set permissions metadata for
new entries.
This commit is contained in:
Thibault Jouan
2014-09-25 21:28:21 +00:00
parent bd66ec25e4
commit 25935f8302
3 changed files with 8 additions and 6 deletions

View File

@@ -19,8 +19,8 @@ module Producer::Core
context 'when a mode was given' do
subject(:mkdir) { Mkdir.new(env, path, 0700) }
it 'creates the directory with given mode' do
expect(remote_fs).to receive(:mkdir).with(anything, 0700)
it 'changes the directory with given mode' do
expect(remote_fs).to receive(:chmod).with(path, 0700)
mkdir.apply
end
end