@@ -204,8 +204,10 @@ def test_symbol_with_backtick
204204 end
205205
206206 def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
207- omit if Gem ::Version . new ( RUBY_VERSION ) < Gem ::Version . new ( '3.1' )
208- write_irbrc <<~'LINES'
207+ rdoc_dir = File . join ( @tmpdir , 'rdoc' )
208+ system ( "bundle exec rdoc -r -o #{ rdoc_dir } " )
209+ write_irbrc <<~LINES
210+ IRB.conf[:EXTRA_DOC_DIRS] = ['#{ rdoc_dir } ']
209211 IRB.conf[:PROMPT][:MY_PROMPT] = {
210212 :PROMPT_I => "%03n> ",
211213 :PROMPT_S => "%03n> ",
@@ -214,32 +216,34 @@ def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_right
214216 IRB.conf[:PROMPT_MODE] = :MY_PROMPT
215217 puts 'start IRB'
216218 LINES
217- start_terminal ( 4 , 19 , %W{ ruby -I/home/aycabta/ruby/reline/lib -I #{ @pwd } /lib #{ @pwd } /exe/irb} , startup_message : 'start IRB' )
218- write ( "Str \C -i" )
219+ start_terminal ( 4 , 19 , %W{ ruby -I#{ @pwd } /lib #{ @pwd } /exe/irb} , startup_message : 'start IRB' )
220+ write ( "IR \C -i" )
219221 close
220222
221223 # This is because on macOS we display different shortcut for displaying the full doc
222224 # 'O' is for 'Option' and 'A' is for 'Alt'
223225 if RUBY_PLATFORM =~ /darwin/
224226 assert_screen ( <<~EOC )
225227 start IRB
226- 001> String
227- StringPress O
228- StructString
228+ 001> IRB
229+ IRBPress Opti
230+ IRB
229231 EOC
230232 else
231233 assert_screen ( <<~EOC )
232234 start IRB
233- 001> String
234- StringPress A
235- StructString
235+ 001> IRB
236+ IRBPress Alt+
237+ IRB
236238 EOC
237239 end
238240 end
239241
240242 def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
241- omit if Gem ::Version . new ( RUBY_VERSION ) < Gem ::Version . new ( '3.1' )
242- write_irbrc <<~'LINES'
243+ rdoc_dir = File . join ( @tmpdir , 'rdoc' )
244+ system ( "bundle exec rdoc -r -o #{ rdoc_dir } " )
245+ write_irbrc <<~LINES
246+ IRB.conf[:EXTRA_DOC_DIRS] = ['#{ rdoc_dir } ']
243247 IRB.conf[:PROMPT][:MY_PROMPT] = {
244248 :PROMPT_I => "%03n> ",
245249 :PROMPT_S => "%03n> ",
@@ -249,13 +253,13 @@ def test_autocomplete_with_showdoc_in_gaps_on_narrow_screen_left
249253 puts 'start IRB'
250254 LINES
251255 start_terminal ( 4 , 12 , %W{ ruby -I#{ @pwd } /lib #{ @pwd } /exe/irb} , startup_message : 'start IRB' )
252- write ( "Str \C -i" )
256+ write ( "IR \C -i" )
253257 close
254258 assert_screen ( <<~EOC )
255259 start IRB
256- 001> String
257- PressString
258- StrinStruct
260+ 001> IRB
261+ PressIRB
262+ IRB
259263 EOC
260264 end
261265
0 commit comments