Skip to content

Commit

Permalink
Fix acl on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
buty4649 committed Oct 31, 2023
1 parent e29b9d4 commit d6b70bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/error_message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,16 @@

before do
touch(file)
chmod(0o000, file)
if windows?
# drop all permissions
`icacls #{file} /inheritancelevel:r`
else
chmod(0o000, file)
end
run_rf("_ #{file}")

# restore permissions
`icalcs #{file} /inheritancelevel:e` if windows?
end

it { expect(last_command_started).not_to be_successfully_executed }
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ def load_fixture(path)
config.include Aruba::Api
config.before { setup_aruba }
end

def windows?
/mswin(?!ce)|mingw|cygwin|bccwin/.match?(RUBY_PLATFORM)
end

0 comments on commit d6b70bc

Please sign in to comment.