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

Local Test Errors Differ Depending on Testing User's :PROMPT_MODE in .irbrc #713

Closed
chadrschroeder opened this issue Sep 16, 2023 · 0 comments · Fixed by #714
Closed

Local Test Errors Differ Depending on Testing User's :PROMPT_MODE in .irbrc #713

chadrschroeder opened this issue Sep 16, 2023 · 0 comments · Fixed by #714

Comments

@chadrschroeder
Copy link
Contributor

Description

I noticed that when my .irbrc has different :PROMPT_MODE configurations, I get different numbers of test failures when I run bundle exec rake test:

:PROMPT_MODE Failures
(No override specified) 19
:DEFAULT 0
:INF_RUBY 22
:NULL 22
:SIMPLE 19
:XMP 22

I can only get all tests to pass when I explicitly use IRB.conf[:PROMPT_MODE] = :DEFAULT. The tests that fail are ones that use run_ruby_file.

One example failure is:

Failure: test_irb_doesnt_echo_line_with_semicolon(TestIRB::EchoingTest):
  <"\r\n" +
  "From: /var/folders/sk/mh9kbvhx4l924d3w9zlhj5zc0000gq/T/irb-20230916-77007-psjqid.rb @ line 1 :\r\n" +
  "\r\n" +
  " => 1: binding.irb\r\n" +
  "\r\n" +
  "123123;\r\n" +
  "123123   ;\r\n" +
  "123123;   \r\n" +
  "if true\r\n" +
  "  123123\r\n" +
  "end;\r\n" +
  "'evaluation ends'\r\n" +
  "exit\r\n" +
  "irb(main):001> irb(main):002> irb(main):003> irb(main):004>                                   irb(main):007> \"evaluation ends\"\r\n" +
  "irb(main):008> "> was expected to include
  <"=> \"evaluation ends\"">.
/Users/username/dev/irb2/irb/test/irb/test_evaluation.rb:40:in `test_irb_doesnt_echo_line_with_semicolon'
     37:         type "exit"
     38:       end
     39:
  => 40:       assert_include(output, "=> \"evaluation ends\"")
     41:       assert_not_include(output, "=> 123123")
     42:     end
     43:   end

The test assertion expects to see => when a value is echoed in the prompt. But that won't always be there depending on the :PROMPT_MODE.

Other tests that fail are in TestIRB::DebugCommandTest.

It used to be possible to get all tests to pass without having any kind of :PROMPT_MODE override specified in .irbrc.

Result of irb_info

Ruby version: 3.2.1
IRB version: irb 1.8.1 (2023-09-04)
InputMethod: RelineInputMethod with Reline 0.3.8
.irbrc path: /Users/username/.rvm/rubies/ruby-3.2.1/.irbrc
RUBY_PLATFORM: x86_64-darwin20
LANG env: en_US.UTF-8
East Asian Ambiguous Width: 1

Terminal Emulator

iTerm2

Setting Files

Are you using ~/.irbrc and ~/.inputrc? Yes. Noted in description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant