Skip to content

Commit

Permalink
Assert different screen result on CI and local machine
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 committed Jul 12, 2023
1 parent 91f5285 commit 6b3a81b
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions test/irb/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def test_symbol_with_backtick
end

def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
omit if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('3.0')
write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ",
Expand All @@ -189,15 +190,28 @@ def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
start_terminal(4, 19, %W{ruby -I/home/aycabta/ruby/reline/lib -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
write("Str\C-i")
close
assert_screen(<<~EOC)
start IRB
001> String
StringPress O
StructString
EOC

# This is because on macOS we display different shortcut for displaying the full doc
# 'O' is for 'Option' and 'A' is for 'Alt'
if RUBY_PLATFORM =~ /darwin/
assert_screen(<<~EOC)
start IRB
001> String
StringPress O
StructString
EOC
else
assert_screen(<<~EOC)
start IRB
001> String
StringPress A
StructString
EOC
end
end

def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
omit if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('3.0')
write_irbrc <<~'LINES'
IRB.conf[:PROMPT][:MY_PROMPT] = {
:PROMPT_I => "%03n> ",
Expand Down

0 comments on commit 6b3a81b

Please sign in to comment.