[ruby/irb] Use IRB's own doc for doc dialog tests
(https://github.com/ruby/irb/pull/743) * Use IRB's own doc for doc dialog tests * Run doc dialog tests for older Rubies too * Remove unnecessary CI setups https://github.com/ruby/irb/commit/97a2b86f0a
This commit is contained in:
parent
83911002f8
commit
85beca6e41
@ -204,8 +204,10 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
|
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
|
||||||
omit if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1')
|
rdoc_dir = File.join(@tmpdir, 'rdoc')
|
||||||
write_irbrc <<~'LINES'
|
system("bundle exec rdoc -r -o #{rdoc_dir}")
|
||||||
|
write_irbrc <<~LINES
|
||||||
|
IRB.conf[:EXTRA_DOC_DIRS] = ['#{rdoc_dir}']
|
||||||
IRB.conf[:PROMPT][:MY_PROMPT] = {
|
IRB.conf[:PROMPT][:MY_PROMPT] = {
|
||||||
:PROMPT_I => "%03n> ",
|
:PROMPT_I => "%03n> ",
|
||||||
:PROMPT_S => "%03n> ",
|
:PROMPT_S => "%03n> ",
|
||||||
@ -214,8 +216,8 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
|
|||||||
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
|
IRB.conf[:PROMPT_MODE] = :MY_PROMPT
|
||||||
puts 'start IRB'
|
puts 'start IRB'
|
||||||
LINES
|
LINES
|
||||||
start_terminal(4, 19, %W{ruby -I/home/aycabta/ruby/reline/lib -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
|
start_terminal(4, 19, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
|
||||||
write("Str\C-i")
|
write("IR\C-i")
|
||||||
close
|
close
|
||||||
|
|
||||||
# This is because on macOS we display different shortcut for displaying the full doc
|
# This is because on macOS we display different shortcut for displaying the full doc
|
||||||
@ -223,23 +225,25 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
|
|||||||
if RUBY_PLATFORM =~ /darwin/
|
if RUBY_PLATFORM =~ /darwin/
|
||||||
assert_screen(<<~EOC)
|
assert_screen(<<~EOC)
|
||||||
start IRB
|
start IRB
|
||||||
001> String
|
001> IRB
|
||||||
StringPress O
|
IRBPress Opti
|
||||||
StructString
|
IRB
|
||||||
EOC
|
EOC
|
||||||
else
|
else
|
||||||
assert_screen(<<~EOC)
|
assert_screen(<<~EOC)
|
||||||
start IRB
|
start IRB
|
||||||
001> String
|
001> IRB
|
||||||
StringPress A
|
IRBPress Alt+
|
||||||
StructString
|
IRB
|
||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
|
def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
|
||||||
omit if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3.1')
|
rdoc_dir = File.join(@tmpdir, 'rdoc')
|
||||||
write_irbrc <<~'LINES'
|
system("bundle exec rdoc -r -o #{rdoc_dir}")
|
||||||
|
write_irbrc <<~LINES
|
||||||
|
IRB.conf[:EXTRA_DOC_DIRS] = ['#{rdoc_dir}']
|
||||||
IRB.conf[:PROMPT][:MY_PROMPT] = {
|
IRB.conf[:PROMPT][:MY_PROMPT] = {
|
||||||
:PROMPT_I => "%03n> ",
|
:PROMPT_I => "%03n> ",
|
||||||
:PROMPT_S => "%03n> ",
|
:PROMPT_S => "%03n> ",
|
||||||
@ -249,13 +253,13 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
|
|||||||
puts 'start IRB'
|
puts 'start IRB'
|
||||||
LINES
|
LINES
|
||||||
start_terminal(4, 12, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
|
start_terminal(4, 12, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB')
|
||||||
write("Str\C-i")
|
write("IR\C-i")
|
||||||
close
|
close
|
||||||
assert_screen(<<~EOC)
|
assert_screen(<<~EOC)
|
||||||
start IRB
|
start IRB
|
||||||
001> String
|
001> IRB
|
||||||
PressString
|
PressIRB
|
||||||
StrinStruct
|
IRB
|
||||||
EOC
|
EOC
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user