File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -58,10 +58,7 @@ def test_console_with_environment
58
58
end
59
59
60
60
def test_console_defaults_to_IRB
61
- config = mock ( "config" , console : nil )
62
- app = mock ( "app" , config : config )
63
- app . expects ( :load_console ) . returns ( nil )
64
-
61
+ app = build_app ( console : nil )
65
62
assert_equal IRB , Rails ::Console . new ( app ) . console
66
63
end
67
64
@@ -127,13 +124,15 @@ def start(argv = [])
127
124
end
128
125
129
126
def app
130
- @app ||= begin
131
- config = mock ( "config" , console : FakeConsole )
132
- app = mock ( "app" , config : config )
133
- app . stubs ( :sandbox= ) . returns ( nil )
134
- app . expects ( :load_console )
135
- app
136
- end
127
+ @app ||= build_app ( console : FakeConsole )
128
+ end
129
+
130
+ def build_app ( config )
131
+ config = mock ( "config" , config )
132
+ app = mock ( "app" , config : config )
133
+ app . stubs ( :sandbox= ) . returns ( nil )
134
+ app . expects ( :load_console )
135
+ app
137
136
end
138
137
139
138
def parse_arguments ( args )
You can’t perform that action at this time.
0 commit comments