aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorDavid Rodríguez de Dios <deivid.rodriguez@gmail.com>2014-04-10 16:02:13 +0200
committerDavid Rodríguez de Dios <deivid.rodriguez@gmail.com>2014-04-10 16:02:13 +0200
commit6fae9ac58147948474c3fa472f0eb04525737d45 (patch)
tree677099bc2ca30b16f99c6d204022e36a4627ff2b /railties/test
parenteb2d555f5c2e504f9de73dd083f148336f5ffa19 (diff)
downloadrails-6fae9ac58147948474c3fa472f0eb04525737d45.tar.gz
rails-6fae9ac58147948474c3fa472f0eb04525737d45.tar.bz2
rails-6fae9ac58147948474c3fa472f0eb04525737d45.zip
Isolate debugger related code
Diffstat (limited to 'railties/test')
-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 87c5527b81..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 if RUBY_VERSION < '2.0.0'
-
def test_no_options
console = Rails::Console.new(app, parse_arguments([]))
- assert !console.debugger? if RUBY_VERSION < '2.0.0'
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 if RUBY_VERSION < '2.0.0'
-
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)