From c91789c76b8cd403c299e28c98a6b046cc4f0af1 Mon Sep 17 00:00:00 2001 From: Jon Leighton Date: Fri, 22 Mar 2013 14:24:36 +0000 Subject: Don't kill the console Use the "quit" command instead. This seems to prevents some weirdness on OS X. See #9761. --- railties/test/application/console_test.rb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'railties/test') diff --git a/railties/test/application/console_test.rb b/railties/test/application/console_test.rb index d586822501..80700a1d64 100644 --- a/railties/test/application/console_test.rb +++ b/railties/test/application/console_test.rb @@ -126,12 +126,6 @@ class FullStackConsoleTest < ActiveSupport::TestCase assert_output "> " end - def kill(pid) - Process.kill('TERM', pid) - Process.wait(pid) - rescue Errno::ESRCH - end - def spawn_console pid = Process.spawn( "#{app_path}/bin/rails console --sandbox", @@ -148,15 +142,13 @@ class FullStackConsoleTest < ActiveSupport::TestCase write_prompt "Post.count", "=> 0" write_prompt "Post.create" write_prompt "Post.count", "=> 1" - - kill pid + @master.puts "quit" pid = spawn_console write_prompt "Post.count", "=> 0" write_prompt "Post.transaction { Post.create; raise }" write_prompt "Post.count", "=> 0" - ensure - kill pid if pid + @master.puts "quit" end end -- cgit v1.2.3