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

Fix be_mode and be_executable matcher to be compatible with Mac OS X v10.4.11 #127

Merged
merged 2 commits into from May 25, 2013
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/serverspec/commands/darwin.rb
Expand Up @@ -11,7 +11,7 @@ def check_file_md5checksum file, expected

def check_mode file, mode
regexp = "^#{mode}$"
"stat -f %A #{escape(file)} | grep -- #{escape(regexp)}"
"stat -f%Lp #{escape(file)} | grep -- #{escape(regexp)}"
end

def check_owner file, owner
Expand All @@ -25,7 +25,7 @@ def check_grouped file, group
end

def get_mode(file)
"stat -f %A #{escape(file)}"
"stat -f%Lp #{escape(file)}"
end

def check_access_by_user file, user, access
Expand Down
4 changes: 2 additions & 2 deletions spec/darwin/commands_spec.rb
Expand Up @@ -43,7 +43,7 @@

describe 'check_mode' do
subject { commands.check_mode('/etc/sudoers', 440) }
it { should eq 'stat -f %A /etc/sudoers | grep -- \\^440\\$' }
it { should eq 'stat -f%Lp /etc/sudoers | grep -- \\^440\\$' }
end

describe 'check_owner' do
Expand All @@ -58,7 +58,7 @@

describe 'get_mode' do
subject { commands.get_mode('/dev') }
it { should eq 'stat -f %A /dev' }
it { should eq 'stat -f%Lp /dev' }
end

describe 'check_access_by_user' do
Expand Down