From 07403de5a8a2d5239a15520513efcb3a5041580f Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Fri, 24 Feb 2023 21:34:35 +0800 Subject: [PATCH] [ruby/irb] Cleanup completion tests (https://github.com/ruby/irb/pull/520) * Remove redundant completion test The test case was introduced to guard an old implementation, which relied on `Module#name`. Commit: https://github.com/ruby/irb/commit/8827d182746396dbf4499c2c1c8c0e9bf8375b7c However, the current implementation has avoided calling `Module#name` completely, so the test case is no longer necessary. Commit: https://github.com/ruby/irb/commit/88311ce3c84251e6f420246cd14efc96e00888be * Remove unnecessary pend --- test/irb/test_completion.rb | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/irb/test_completion.rb b/test/irb/test_completion.rb index 1ab7dbbb19..b93b5e804a 100644 --- a/test/irb/test_completion.rb +++ b/test/irb/test_completion.rb @@ -11,23 +11,6 @@ module TestIRB IRB::InputCompletor.class_variable_set(:@@files_from_load_path, nil) end - def test_nonstring_module_name - begin - require "irb/completion" - bug5938 = '[ruby-core:42244]' - bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : [] - cmds = bundle_exec + %W[-W0 -rirb -rirb/completion -e IRB.setup(__FILE__) - -e IRB.conf[:MAIN_CONTEXT]=IRB::Irb.new.context - -e module\sFoo;def\sself.name;//;end;end - -e IRB::InputCompletor::CompletionProc.call("[1].first.") - -- -f --] - status = assert_in_out_err(cmds, "", //, [], bug5938) - assert(status.success?, bug5938) - rescue LoadError - pend "cannot load irb/completion" - end - end - class TestMethodCompletion < TestCompletion def test_complete_string assert_include(IRB::InputCompletor.retrieve_completion_data("'foo'.up", bind: binding), "'foo'.upcase") @@ -131,7 +114,6 @@ module TestIRB end def test_complete_require_library_name_first - pend 'Need to use virtual library paths' candidates = IRB::InputCompletor::CompletionProc.("'csv", "require ", "") assert_equal "'csv", candidates.first end