Skip to content

Commit cbacac9

Browse files
committed
Fix yamatanooroti test failures from startup banner
- Suppress banner when `-f` flag is used (RC=false) - Disable banner in yamatanooroti test setup via irbrc - Prepend banner disable in write_irbrc helper
1 parent 86a64a7 commit cbacac9

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/irb.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,7 @@ def inspect
597597
private
598598

599599
def show_startup_message?
600+
return false unless IRB.conf[:RC]
600601
return false unless IRB.conf.fetch(:SHOW_BANNER, true)
601602
return true if ENV['TEST_IRB_FORCE_INTERACTIVE']
602603

test/irb/yamatanooroti/test_rendering.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def setup
2626
@irbrc_backup = ENV['IRBRC']
2727
@irbrc_file = ENV['IRBRC'] = File.join(@tmpdir, 'temporaty_irbrc')
2828
File.unlink(@irbrc_file) if File.exist?(@irbrc_file)
29+
File.write(@irbrc_file, "IRB.conf[:SHOW_BANNER] = false\n")
2930
ENV['HOME'] = File.join(@tmpdir, 'home')
3031
ENV['XDG_CONFIG_HOME'] = File.join(@tmpdir, 'xdg_config_home')
3132
end
@@ -520,6 +521,7 @@ def test_debug_integration_doesnt_hint_debugger_commands_in_nomultiline_mode
520521

521522
def write_irbrc(content)
522523
File.open(@irbrc_file, 'w') do |f|
524+
f.write "IRB.conf[:SHOW_BANNER] = false\n"
523525
f.write content
524526
end
525527
end

0 commit comments

Comments
 (0)