diff options
Diffstat (limited to 'spec/unit/mixin/command_spec.rb')
-rw-r--r-- | spec/unit/mixin/command_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/unit/mixin/command_spec.rb b/spec/unit/mixin/command_spec.rb index dfe7b148ec..0c2f6da188 100644 --- a/spec/unit/mixin/command_spec.rb +++ b/spec/unit/mixin/command_spec.rb @@ -43,16 +43,16 @@ describe Chef::Mixin::Command, :volatile do end it "should respect locale when specified explicitly" do - popen4("echo $LC_ALL", :environment => {"LC_ALL" => "es"}) do |pid, stdin, stdout, stderr| + popen4("echo $LC_ALL", :environment => { "LC_ALL" => "es" }) do |pid, stdin, stdout, stderr| expect(stdout.read.strip).to eq("es") end end it "should end when the child process reads from STDIN and a block is given" do expect {Timeout.timeout(10) do - popen4("ruby -e 'while gets; end'", :waitlast => true) do |pid, stdin, stdout, stderr| - (1..5).each { |i| stdin.puts "#{i}" } - end + popen4("ruby -e 'while gets; end'", :waitlast => true) do |pid, stdin, stdout, stderr| + (1..5).each { |i| stdin.puts "#{i}" } + end end }.not_to raise_error end @@ -61,8 +61,8 @@ describe Chef::Mixin::Command, :volatile do it "returns immediately after the first child process exits" do expect {Timeout.timeout(10) do - evil_forker="exit if fork; 10.times { sleep 1}" - popen4("ruby -e '#{evil_forker}'") do |pid,stdin,stdout,stderr| + evil_forker = "exit if fork; 10.times { sleep 1}" + popen4("ruby -e '#{evil_forker}'") do |pid, stdin, stdout, stderr| end end}.not_to raise_error end @@ -93,7 +93,7 @@ describe Chef::Mixin::Command, :volatile do # Serdar - During Solaris tests, we've seen that processes # are taking a long time to exit. Bumping timeout now to 10. expect {Timeout.timeout(10) do - evil_forker="exit if fork; 10.times { sleep 1}" + evil_forker = "exit if fork; 10.times { sleep 1}" run_command(:command => "ruby -e '#{evil_forker}'") end}.not_to raise_error end |