diff options
author | aycabta <aycabta@gmail.com> | 2021-03-24 14:55:05 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-03-24 15:11:41 +0900 |
commit | 0927756e58c7d68517a1468f2327ce50989ff3f2 (patch) | |
tree | deb83d6f2ca40f4b0052092f9e066321d5781ee2 /test | |
parent | 0259ee600857729d289959ddf5973c25159209b2 (diff) |
[ruby/irb] Complete require and require_relative
https://github.com/ruby/irb/commit/1c61178b4c
Diffstat (limited to 'test')
-rw-r--r-- | test/irb/test_completion.rb | 14 |
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 |