Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix console_test to make pass after IRB's behavior change #51667

Merged
merged 1 commit into from May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions railties/test/application/console_test.rb
Expand Up @@ -25,11 +25,11 @@ def teardown
teardown_app
end

def write_prompt(command, expected_output = nil)
def write_prompt(command, expected_output = nil, prompt: "> ")
@primary.puts command
assert_output command, @primary
assert_output expected_output, @primary, 100 if expected_output
assert_output "> ", @primary
assert_output prompt, @primary
end

def spawn_console(options, wait_for_prompt: true, env: {})
Expand Down Expand Up @@ -123,21 +123,21 @@ def test_production_console_prompt
options = "-e production"
spawn_console(options)

write_prompt "123", "app-template(prod)> 123"
write_prompt "123", prompt: "app-template(prod)>"
end

def test_development_console_prompt
options = "-e development"
spawn_console(options)

write_prompt "123", "app-template(dev)> 123"
write_prompt "123", prompt: "app-template(dev)> "
end

def test_test_console_prompt
options = "-e test"
spawn_console(options)

write_prompt "123", "app-template(test)> 123"
write_prompt "123", prompt: "app-template(test)> "
end

def test_helper_helper_method
Expand Down Expand Up @@ -219,7 +219,7 @@ def test_console_respects_user_defined_prompt_mode
options = "-e test"
spawn_console(options, env: { "IRBRC" => irbrc.path })

write_prompt "123", ">> 123"
write_prompt "123", prompt: ">> "
ensure
File.unlink(irbrc)
end
Expand Down