From 280dcb0c5d13a4ac276b8b680b095d050bc06ded Mon Sep 17 00:00:00 2001 From: "Julian C. Dunn" Date: Tue, 18 Dec 2012 13:14:28 -0500 Subject: [MIXLIB-6] Fix test due to /bin being a symlink on Fedora. Use /tmp instead --- spec/mixlib/shellout_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 71ecfef..68225c6 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -344,7 +344,7 @@ describe Mixlib::ShellOut do let(:options) { { :cwd => cwd } } context 'when running under Unix', :unix_only do - let(:cwd) { '/bin' } + let(:cwd) { '/tmp' } let(:cmd) { 'pwd' } it "should chdir to the working directory" do -- cgit v1.2.1 From ea22de879c03a19e306eaee6c4ad911dbda642cd Mon Sep 17 00:00:00 2001 From: "Julian C. Dunn" Date: Wed, 4 Dec 2013 11:09:59 -0500 Subject: [MIXLIB-6] Use conditional to determine whether to use /tmp or /bin as a cwd for the test. --- spec/mixlib/shellout_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 68225c6..150aa71 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -344,7 +344,7 @@ describe Mixlib::ShellOut do let(:options) { { :cwd => cwd } } context 'when running under Unix', :unix_only do - let(:cwd) { '/tmp' } + let(:cwd) { File.symlink?('/bin') ? '/tmp' : '/bin' } let(:cmd) { 'pwd' } it "should chdir to the working directory" do -- cgit v1.2.1 From d233f37107665e37879a312ce142f006b003affd Mon Sep 17 00:00:00 2001 From: "Julian C. Dunn" Date: Wed, 8 Jan 2014 16:06:23 -0500 Subject: [MIXLIB-6] Add comment describing why the test was changed, per Dan DeLeo. --- spec/mixlib/shellout_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/mixlib/shellout_spec.rb b/spec/mixlib/shellout_spec.rb index 150aa71..44f29d7 100644 --- a/spec/mixlib/shellout_spec.rb +++ b/spec/mixlib/shellout_spec.rb @@ -344,6 +344,8 @@ describe Mixlib::ShellOut do let(:options) { { :cwd => cwd } } context 'when running under Unix', :unix_only do + # Use /bin for tests only if it is not a symlink. Some + # distributions (e.g. Fedora) symlink it to /usr/bin let(:cwd) { File.symlink?('/bin') ? '/tmp' : '/bin' } let(:cmd) { 'pwd' } -- cgit v1.2.1