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 easter_egg run without RDoc, fix input-method test run without RDoc #998

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Sep 3, 2024

RDoc is planned to be a bundled gem, not a default gem in the future.
Even if RDoc is not available, we want to run most of the tests in test_input_method.rb.

This pull request will:

  • Reduce skipping test with if defined?(RDoc)
  • Make easter_egg not depend on RDoc

EasterEgg with no pager

When USE_PAGER is set to false, or no pager command is available, IRB::Pager.page will fallback to STDOUT.
We need to print "\e[?1049h" to switch to alternate screen and switch back to normal screen after pager is finished because easter_egg is called while rendering document dialog.
We need to STDIN.raw { STDIN.getc } wait for more than 0 second before switch back to normal screen.

@@ -79,7 +79,7 @@ def test_initialization_with_use_autocomplete
IRB::RelineInputMethod.new(IRB::RegexpCompletor.new)

assert Reline.autocompletion
assert_not_equal empty_proc, Reline.dialog_proc(:show_doc).dialog_proc
assert_not_equal empty_proc, Reline.dialog_proc(:show_doc).dialog_proc if defined?(RDoc)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use omit "...." unless defined?(RDoc) in the tests instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! updated

@tompng tompng merged commit 30fa159 into ruby:master Sep 3, 2024
30 checks passed
@tompng tompng deleted the fix_no_rdoc branch September 3, 2024 15:45
matzbot pushed a commit to ruby/ruby that referenced this pull request Sep 3, 2024
run without RDoc
(ruby/irb#998)

* EasterEgg no longer depend on RDoc

* Run most of the input-method tests even if RDoc is not avialable

ruby/irb@30fa1595d9
@st0012 st0012 added the bug Something isn't working label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

2 participants