Skip to content

Commit 8a56ad0

Browse files
authored
Fix display_document test fails in tty environment (#1185)
1 parent 6b6874b commit 8a56ad0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

test/irb/test_input_method.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ def setup
111111
end
112112

113113
def display_document(target, bind, driver = nil)
114+
use_pager = IRB.conf[:USE_PAGER]
115+
IRB.conf[:USE_PAGER] = false
114116
input_method = IRB::RelineInputMethod.new(IRB::RegexpCompletor.new)
115117
input_method.instance_variable_set(:@rdoc_ri_driver, driver) if driver
116118
input_method.instance_variable_set(:@completion_params, ['', target, '', bind])
117119
input_method.display_document(target)
120+
ensure
121+
IRB.conf[:USE_PAGER] = use_pager
118122
end
119123

120124
def test_perfectly_matched_namespace_triggers_document_display

0 commit comments

Comments
 (0)