Skip to content

Commit 4b46041

Browse files
committed
Fix console_test to work with both IRB's RelineInputMethod and StdioInputMethod
1 parent 2b14603 commit 4b46041

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

railties/test/application/console_test.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def teardown
2525
teardown_app
2626
end
2727

28-
def write_prompt(command, expected_output = nil)
28+
def write_prompt(command, expected_output = nil, prompt: "> ")
2929
@primary.puts command
3030
assert_output command, @primary
3131
assert_output expected_output, @primary, 100 if expected_output
32-
assert_output "> ", @primary
32+
assert_output prompt, @primary
3333
end
3434

3535
def spawn_console(options, wait_for_prompt: true, env: {})
@@ -123,21 +123,21 @@ def test_production_console_prompt
123123
options = "-e production"
124124
spawn_console(options)
125125

126-
write_prompt "123", "app-template(prod)> 123"
126+
write_prompt "123", prompt: "app-template(prod)>"
127127
end
128128

129129
def test_development_console_prompt
130130
options = "-e development"
131131
spawn_console(options)
132132

133-
write_prompt "123", "app-template(dev)> 123"
133+
write_prompt "123", prompt: "app-template(dev)> "
134134
end
135135

136136
def test_test_console_prompt
137137
options = "-e test"
138138
spawn_console(options)
139139

140-
write_prompt "123", "app-template(test)> 123"
140+
write_prompt "123", prompt: "app-template(test)> "
141141
end
142142

143143
def test_helper_helper_method
@@ -219,7 +219,7 @@ def test_console_respects_user_defined_prompt_mode
219219
options = "-e test"
220220
spawn_console(options, env: { "IRBRC" => irbrc.path })
221221

222-
write_prompt "123", ">> 123"
222+
write_prompt "123", prompt: ">> "
223223
ensure
224224
File.unlink(irbrc)
225225
end

0 commit comments

Comments
 (0)