diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-08 21:48:27 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-03-08 21:48:28 -0300 |
commit | 11dd15a5c2bd08f399793f45c04075c2fbb20861 (patch) | |
tree | c6ef46abc5653ac7ae22c9679e507a341e05f6e2 /railties/test/commands | |
parent | e3c56ad9139ca98f2a538566b2810f278b32c375 (diff) | |
download | rails-11dd15a5c2bd08f399793f45c04075c2fbb20861.tar.gz rails-11dd15a5c2bd08f399793f45c04075c2fbb20861.tar.bz2 rails-11dd15a5c2bd08f399793f45c04075c2fbb20861.zip |
Fix failing test regarding console change to fix sandboxing
Introduced in be3e10cd26bc8ec29c6474d03a08a8e733108e7d.
Diffstat (limited to 'railties/test/commands')
-rw-r--r-- | railties/test/commands/console_test.rb | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/railties/test/commands/console_test.rb b/railties/test/commands/console_test.rb index 6be4a5fe89..3c784b43be 100644 --- a/railties/test/commands/console_test.rb +++ b/railties/test/commands/console_test.rb @@ -58,10 +58,7 @@ class Rails::ConsoleTest < ActiveSupport::TestCase end def test_console_defaults_to_IRB - config = mock("config", console: nil) - app = mock("app", config: config) - app.expects(:load_console).returns(nil) - + app = build_app(console: nil) assert_equal IRB, Rails::Console.new(app).console end @@ -127,13 +124,15 @@ class Rails::ConsoleTest < ActiveSupport::TestCase end def app - @app ||= begin - config = mock("config", console: FakeConsole) - app = mock("app", config: config) - app.stubs(:sandbox=).returns(nil) - app.expects(:load_console) - app - end + @app ||= build_app(console: FakeConsole) + end + + def build_app(config) + config = mock("config", config) + app = mock("app", config: config) + app.stubs(:sandbox=).returns(nil) + app.expects(:load_console) + app end def parse_arguments(args) |