Skip to content

Commit

Permalink
Merge pull request redhat-openstack#109 from mhaskel/osx-test-fixes
Browse files Browse the repository at this point in the history
OSX doesn't support the -e flag to echo.
  • Loading branch information
hunner committed Jun 12, 2014
2 parents 1170a53 + 842915d commit 29ffe09
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions spec/acceptance/ini_setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,11 @@

context '=> absent for key/value' do
before :all do
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
if fact('osfamily') == 'Darwin'
shell("echo \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
else
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
end
end

pp = <<-EOS
Expand Down Expand Up @@ -111,7 +115,11 @@

context '=> absent for section', :pending => "cannot ensure absent on a section" do
before :all do
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
if fact('osfamily') == 'Darwin'
shell("echo \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
else
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
end
end
after :all do
shell("cat #{tmpdir}/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
Expand Down Expand Up @@ -141,7 +149,11 @@

context '=> absent for global' do
before :all do
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
if fact('osfamily') == 'Darwin'
shell("echo \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
else
shell("echo -e \"four = five\n[one]\ntwo = three\" > #{tmpdir}/ini_setting.ini")
end
end
after :all do
shell("cat #{tmpdir}/ini_setting.ini", :acceptable_exit_codes => [0,1,2])
Expand Down
6 changes: 5 additions & 1 deletion spec/acceptance/ini_subsetting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@

context 'ensure => absent' do
before :all do
shell("echo -e \"[one]\nkey = alphabet betatrons\" > #{tmpdir}/ini_subsetting.ini")
if fact('osfamily') == 'Darwin'
shell("echo \"[one]\nkey = alphabet betatrons\" > #{tmpdir}/ini_subsetting.ini")
else
shell("echo -e \"[one]\nkey = alphabet betatrons\" > #{tmpdir}/ini_subsetting.ini")
end
end

pp = <<-EOS
Expand Down

0 comments on commit 29ffe09

Please sign in to comment.