Browse files

Don't kill the console

Use the "quit" command instead. This seems to prevents some weirdness on
OS X. See #9761.
  • Loading branch information...
1 parent d8d6dad commit c91789c76b8cd403c299e28c98a6b046cc4f0af1 @jonleighton jonleighton committed Mar 22, 2013
Showing with 2 additions and 10 deletions.
  1. +2 −10 railties/test/application/console_test.rb
View
12 railties/test/application/console_test.rb
@@ -126,12 +126,6 @@ def write_prompt(command, expected_output = nil)
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 @@ def test_sandbox
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

0 comments on commit c91789c

Please sign in to comment.