summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_completion.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb
index 984453d059..de043c7088 100644
--- a/test/irb/test_completion.rb
+++ b/test/irb/test_completion.rb
@@ -55,5 +55,19 @@ module TestIRB
namespace = IRB::InputCompletor.retrieve_completion_data("1.positive?", bind: binding, doc_namespace: true)
assert_equal "Integer.positive?", namespace
end
+
+ def test_complete_require
+ candidates = IRB::InputCompletor::CompletionProc.("'irb", "require ", "")
+ %w['irb/init 'irb/ruby-lex].each do |word|
+ assert_include candidates, word
+ end
+ end
+
+ def test_complete_require_relative
+ candidates = IRB::InputCompletor::CompletionProc.("'lib/irb", "require_relative ", "")
+ %w['lib/irb/init 'lib/irb/ruby-lex].each do |word|
+ assert_include candidates, word
+ end
+ end
end
end