Skip to content

Commit

Permalink
Specify all octal file modes with 0o prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
mvz committed Jun 5, 2020
1 parent 1fbf0d0 commit 9ee5246
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Check if command can be found in PATH
RSpec.describe 'Check if command can be found in PATH', :type => :aruba do
let(:file) { 'file.sh' }
before(:each) { touch(file) }
before(:each) { chmod(0755, file) }
before(:each) { chmod(0o755, file) }
before(:each) { prepend_environment_variable('PATH', format('%s:', expand_path('.')) }

it { expect(file).to be_an_existing_executable }
Expand All @@ -28,7 +28,7 @@ Feature: Check if command can be found in PATH
let(:file) { 'file.sh' }
before(:each) { touch(file) }
before(:each) { chmod(0755, file) }
before(:each) { chmod(0o755, file) }
before(:each) { prepend_environment_variable('PATH', format('%s:', expand_path('.'))) }
it { expect(file).to be_a_command_found_in_path }
Expand Down Expand Up @@ -81,7 +81,7 @@ Feature: Check if command can be found in PATH
before :each do
files.each do |f|
touch(f)
chmod(0755, f)
chmod(0o755, f)
end
end
Expand All @@ -103,7 +103,7 @@ Feature: Check if command can be found in PATH
before :each do
touch(files.first)
chmod(0755, files.first)
chmod(0o755, files.first)
end
before(:each) { prepend_environment_variable('PATH', format('%s:', expand_path('.'))) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Check if path exists and is an executable file
RSpec.describe 'Check if file exists and is an executable file', :type => :aruba do
let(:file) { 'file.txt' }
before(:each) { touch(file) }
before(:each) { chmod(0755, file) }
before(:each) { chmod(0o755, file) }

it { expect(file).to be_an_existing_executable }
end
Expand All @@ -26,7 +26,7 @@ Feature: Check if path exists and is an executable file
RSpec.describe 'Check if file exists and is an executable file', :type => :aruba do
let(:file) { 'file.txt' }
before(:each) { touch(file) }
before(:each) { chmod(0755, file) }
before(:each) { chmod(0o755, file) }
it { expect(file).to be_an_existing_executable }
end
Expand Down Expand Up @@ -58,7 +58,7 @@ Feature: Check if path exists and is an executable file
before :each do
files.each do |f|
touch(f)
chmod(0755, f)
chmod(0o755, f)
end
end
Expand All @@ -78,7 +78,7 @@ Feature: Check if path exists and is an executable file
before :each do
touch(files.first)
chmod(0755, files.first)
chmod(0o755, files.first)
end
it { expect(files).to include an_existing_executable }
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/api/filesystem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def overwrite_file(name, content)
# Change file system permissions of file
#
# @param [Octal] mode
# File system mode, eg. 0755
# File system mode, eg. 0o755
#
# @param [String] file_name
# Name of file to be modified. This file needs to be present to succeed
Expand Down
2 changes: 1 addition & 1 deletion lib/aruba/cucumber/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

Given(/^(?:an|the) executable(?: named)? "([^"]*)" with:$/) do |file_name, file_content|
step %(a file named "#{file_name}" with mode "0755" and with:), file_content
step %(a file named "#{file_name}" with mode "0o755" and with:), file_content
end

Given(/^(?:a|the) file(?: named)? "([^"]*)" with "([^"]*)"$/) do |file_name, file_content|
Expand Down

0 comments on commit 9ee5246

Please sign in to comment.