Skip to content

Commit eb1691f

Browse files
committed
Fix completion tests
1 parent cd8f01e commit eb1691f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/irb/test_completion.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: false
22
require "test/unit"
3+
require "pathname"
34
require "irb"
45

56
module TestIRB
@@ -96,7 +97,7 @@ def test_complete_require_with_pathname_in_load_path
9697
$LOAD_PATH << test_path
9798

9899
candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
99-
assert_equal ["'foo"], candidates
100+
assert_include candidates, "'foo"
100101
ensure
101102
$LOAD_PATH.pop if test_path
102103
FileUtils.remove_entry(temp_dir) if temp_dir
@@ -110,7 +111,7 @@ def test_complete_require_with_string_convertable_in_load_path
110111
$LOAD_PATH << object
111112

112113
candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
113-
assert_equal ["'foo"], candidates
114+
assert_include candidates, "'foo"
114115
ensure
115116
$LOAD_PATH.pop if object
116117
FileUtils.remove_entry(temp_dir) if temp_dir
@@ -121,7 +122,9 @@ def test_complete_require_with_malformed_object_in_load_path
121122
def object.to_s; raise; end
122123
$LOAD_PATH << object
123124

124-
assert_empty IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
125+
assert_nothing_raised do
126+
IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
127+
end
125128
ensure
126129
$LOAD_PATH.pop if object
127130
end

0 commit comments

Comments
 (0)