spec/beaker/host/unix/file_spec.rb in beaker-4.21.0 vs spec/beaker/host/unix/file_spec.rb in beaker-4.22.0

- old
+ new

@@ -194,9 +194,31 @@ expect( instance ).to receive( :execute ).with( "chown \-R #{user} #{path}" ) instance.chown( user, path, true ) end end + describe '#chmod' do + context 'not recursive' do + it 'calls execute with chmod' do + path = '/path/to/file' + mod = '+x' + + expect( instance ).to receive(:execute).with("chmod #{mod} #{path}") + instance.chmod(mod, path) + end + end + + context 'recursive' do + it 'calls execute with chmod' do + path = '/path/to/file' + mod = '+x' + + expect( instance ).to receive(:execute).with("chmod -R #{mod} #{path}") + instance.chmod(mod, path, true) + end + end + end + describe '#chgrp' do let (:group) { 'somegroup' } let (:path) { '/path/to/chgrp/on' } it 'calls the system method' do