Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set permissions to values which are supported on Windows #398

Merged
2 commits merged into from
May 10, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/dependency_decisions.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---
- - :approve
- win32console
- :who:
:why:
:when: 2016-05-09 14:57:58.000000000 Z
- - :whitelist
- MIT
- :who:
Expand Down
8 changes: 4 additions & 4 deletions features/matchers/path/have_permissions.feature
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Feature: Check if path has permissions in filesystem

RSpec.describe 'Check if path has permissions', :type => :aruba do
let(:file) { 'file.txt' }
let(:permissions) { 0700 }
let(:permissions) { 0600 }

before(:each) { touch(file) }
before(:each) { chmod(permissions, file) }
Expand Down Expand Up @@ -67,7 +67,7 @@ Feature: Check if path has permissions in filesystem

RSpec.describe 'Check if path has permissions', :type => :aruba do
let(:files) { %w(file1.txt file2.txt) }
let(:permissions) { 0700 }
let(:permissions) { 0600 }

before :each do
files.each do |f|
Expand All @@ -89,7 +89,7 @@ Feature: Check if path has permissions in filesystem

RSpec.describe 'Check if path has permissions', :type => :aruba do
let(:files) { %w(file1.txt file2.txt) }
let(:permissions) { 0700 }
let(:permissions) { 0600 }

before :each do
touch(files.first)
Expand All @@ -109,7 +109,7 @@ Feature: Check if path has permissions in filesystem

RSpec.describe 'Check if path has permissions', :type => :aruba do
let(:path) { 'file.txt' }
let(:permissions) { 0777 }
let(:permissions) { 0700 }

it { expect(path).to have_permissions permissions }
end
Expand Down
14 changes: 7 additions & 7 deletions spec/aruba/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def actual_permissions

let(:file_name) { @file_name }
let(:file_path) { @file_path }
let(:permissions) { '0655' }
let(:permissions) { '0644' }

before :each do
@aruba.set_environment_variable 'HOME', File.expand_path(@aruba.aruba.current_directory)
Expand All @@ -797,20 +797,20 @@ def actual_permissions

context 'when file exists' do
context 'and permissions are given as string' do
it { expect(actual_permissions).to eq('0655') }
it { expect(actual_permissions).to eq('0644') }
end

context 'and permissions are given as octal number' do
let(:permissions) { 0655 }
it { expect(actual_permissions).to eq('0655') }
let(:permissions) { 0644 }
it { expect(actual_permissions).to eq('0644') }
end

context 'and path has ~ in it' do
let(:path) { random_string }
let(:file_name) { File.join('~', path) }
let(:file_path) { File.join(@aruba.aruba.current_directory, path) }

it { expect(actual_permissions).to eq('0655') }
it { expect(actual_permissions).to eq('0644') }
end
end
end
Expand All @@ -819,7 +819,7 @@ def actual_permissions
let(:file_name) { @file_name }
let(:file_path) { @file_path }

let(:permissions) { '0655' }
let(:permissions) { '0644' }

before :each do
@aruba.set_environment_variable 'HOME', File.expand_path(@aruba.aruba.current_directory)
Expand Down Expand Up @@ -868,7 +868,7 @@ def actual_permissions
end

context 'and fails because the permissions are the same although they should be different' do
let(:different_permissions) { 0655 }
let(:different_permissions) { 0644 }

it { expect { @aruba.check_filesystem_permissions(different_permissions, file_name, false) }.to raise_error }
end
Expand Down