summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2022-09-21 14:53:06 +0100
committergit <svn-admin@ruby-lang.org>2022-09-21 22:59:45 +0900
commitc21f820b496351d0f5a8df68192a510973369ac7 (patch)
treef8d63771cae5f9552f9e0425aa48cdbc3d41eb05 /test
parent6325fc885474937e1250d6605fd594cf70f0794c (diff)
[ruby/irb] Fix completion tests
https://github.com/ruby/irb/commit/eb1691f636
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_completion.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb
index 4bc3fc7783..a3349bc049 100644
--- a/test/irb/test_completion.rb
+++ b/test/irb/test_completion.rb
@@ -1,5 +1,6 @@
# frozen_string_literal: false
require "test/unit"
+require "pathname"
require "irb"
module TestIRB
@@ -96,7 +97,7 @@ module TestIRB
$LOAD_PATH << test_path
candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
- assert_equal ["'foo"], candidates
+ assert_include candidates, "'foo"
ensure
$LOAD_PATH.pop if test_path
FileUtils.remove_entry(temp_dir) if temp_dir
@@ -110,7 +111,7 @@ module TestIRB
$LOAD_PATH << object
candidates = IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
- assert_equal ["'foo"], candidates
+ assert_include candidates, "'foo"
ensure
$LOAD_PATH.pop if object
FileUtils.remove_entry(temp_dir) if temp_dir
@@ -121,7 +122,9 @@ module TestIRB
def object.to_s; raise; end
$LOAD_PATH << object
- assert_empty IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
+ assert_nothing_raised do
+ IRB::InputCompletor::CompletionProc.("'foo", "require ", "")
+ end
ensure
$LOAD_PATH.pop if object
end