[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:8827d18274
However, the current implementation has avoided calling `Module#name` completely, so the test case is no longer necessary. Commit:88311ce3c8
* Remove unnecessary pend
This commit is contained in:
parent
5d5ff6e5ed
commit
07403de5a8
@ -11,23 +11,6 @@ module TestIRB
|
|||||||
IRB::InputCompletor.class_variable_set(:@@files_from_load_path, nil)
|
IRB::InputCompletor.class_variable_set(:@@files_from_load_path, nil)
|
||||||
end
|
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
|
class TestMethodCompletion < TestCompletion
|
||||||
def test_complete_string
|
def test_complete_string
|
||||||
assert_include(IRB::InputCompletor.retrieve_completion_data("'foo'.up", bind: binding), "'foo'.upcase")
|
assert_include(IRB::InputCompletor.retrieve_completion_data("'foo'.up", bind: binding), "'foo'.upcase")
|
||||||
@ -131,7 +114,6 @@ module TestIRB
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_complete_require_library_name_first
|
def test_complete_require_library_name_first
|
||||||
pend 'Need to use virtual library paths'
|
|
||||||
candidates = IRB::InputCompletor::CompletionProc.("'csv", "require ", "")
|
candidates = IRB::InputCompletor::CompletionProc.("'csv", "require ", "")
|
||||||
assert_equal "'csv", candidates.first
|
assert_equal "'csv", candidates.first
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user