diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-11 13:55:10 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-11 13:55:10 -0300 |
commit | 7bb8fd2f641c3416522e647ed32a3142ccc1e01b (patch) | |
tree | f32a83e4d4345558db39dab0cb46e9a692158b13 /railties/test/commands | |
parent | 4e9c0b7874b0c01891f79af9ca2dd110a0529c50 (diff) | |
parent | 545afc150e4491a69d72d61864680b98dce5a7b7 (diff) | |
download | rails-7bb8fd2f641c3416522e647ed32a3142ccc1e01b.tar.gz rails-7bb8fd2f641c3416522e647ed32a3142ccc1e01b.tar.bz2 rails-7bb8fd2f641c3416522e647ed32a3142ccc1e01b.zip |
Merge pull request #14646 from deivid-rodriguez/provide_byebug_by_default
Improve debugging support
Diffstat (limited to 'railties/test/commands')
-rw-r--r-- | railties/test/commands/console_test.rb | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/railties/test/commands/console_test.rb b/railties/test/commands/console_test.rb index a34beaedb3..1273f9d4c2 100644 --- a/railties/test/commands/console_test.rb +++ b/railties/test/commands/console_test.rb @@ -19,14 +19,8 @@ class Rails::ConsoleTest < ActiveSupport::TestCase assert console.sandbox? end - def test_debugger_option - console = Rails::Console.new(app, parse_arguments(["--debugger"])) - assert console.debugger? - end - def test_no_options console = Rails::Console.new(app, parse_arguments([])) - assert !console.debugger? assert !console.sandbox? end @@ -36,13 +30,6 @@ class Rails::ConsoleTest < ActiveSupport::TestCase assert_match(/Loading \w+ environment \(Rails/, output) end - def test_start_with_debugger - rails_console = Rails::Console.new(app, parse_arguments(["--debugger"])) - rails_console.expects(:require_debugger).returns(nil) - - silence_stream(STDOUT) { rails_console.start } - end - def test_start_with_sandbox app.expects(:sandbox=).with(true) FakeConsole.expects(:start) @@ -52,6 +39,25 @@ class Rails::ConsoleTest < ActiveSupport::TestCase assert_match(/Loading \w+ environment in sandbox \(Rails/, output) end + if RUBY_VERSION < '2.0.0' + def test_debugger_option + console = Rails::Console.new(app, parse_arguments(["--debugger"])) + assert console.debugger? + end + + def test_no_options_does_not_set_debugger_flag + console = Rails::Console.new(app, parse_arguments([])) + assert !console.debugger? + end + + def test_start_with_debugger + rails_console = Rails::Console.new(app, parse_arguments(["--debugger"])) + rails_console.expects(:require_debugger).returns(nil) + + silence_stream(STDOUT) { rails_console.start } + end + end + def test_console_with_environment start ["-e production"] assert_match(/\sproduction\s/, output) |