From da851739e7372b698f26b67b74bf3d1c98f70662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20G=C3=BCnnewig?= Date: Mon, 9 May 2016 10:55:56 +0200 Subject: [PATCH 1/2] Set permissions to values which are supported on Windows --- features/matchers/path/have_permissions.feature | 8 ++++---- spec/aruba/api_spec.rb | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/features/matchers/path/have_permissions.feature b/features/matchers/path/have_permissions.feature index cb3e9ce6f..b0a9d6e60 100644 --- a/features/matchers/path/have_permissions.feature +++ b/features/matchers/path/have_permissions.feature @@ -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) } @@ -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| @@ -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) @@ -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 diff --git a/spec/aruba/api_spec.rb b/spec/aruba/api_spec.rb index c34f2cabb..e792252e3 100644 --- a/spec/aruba/api_spec.rb +++ b/spec/aruba/api_spec.rb @@ -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) @@ -797,12 +797,12 @@ 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 @@ -810,7 +810,7 @@ def actual_permissions 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 @@ -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) @@ -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 From 3e2cf52f42a44c9a0576cbe8bbd87f2a82734b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20G=C3=BCnnewig?= Date: Mon, 9 May 2016 14:58:40 +0200 Subject: [PATCH 2/2] Approve the use of window32console for the sake of making the test pass --- doc/dependency_decisions.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/dependency_decisions.yml b/doc/dependency_decisions.yml index 966fb17a5..b8831bab2 100644 --- a/doc/dependency_decisions.yml +++ b/doc/dependency_decisions.yml @@ -1,4 +1,9 @@ --- +- - :approve + - win32console + - :who: + :why: + :when: 2016-05-09 14:57:58.000000000 Z - - :whitelist - MIT - :who: