aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/commands
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-11 13:55:10 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-04-11 13:55:10 -0300
commit7bb8fd2f641c3416522e647ed32a3142ccc1e01b (patch)
treef32a83e4d4345558db39dab0cb46e9a692158b13 /railties/test/commands
parent4e9c0b7874b0c01891f79af9ca2dd110a0529c50 (diff)
parent545afc150e4491a69d72d61864680b98dce5a7b7 (diff)
downloadrails-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.rb32
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)