2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2012-01-27 15:53:37 -05:00
|
|
|
require 'test/unit'
|
|
|
|
|
|
|
|
module TestIRB
|
|
|
|
class TestCompletion < Test::Unit::TestCase
|
|
|
|
def test_nonstring_module_name
|
2012-01-29 20:39:52 -05:00
|
|
|
begin
|
|
|
|
require "irb/completion"
|
|
|
|
bug5938 = '[ruby-core:42244]'
|
|
|
|
cmds = %W[-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
|
|
|
|
skip "cannot load irb/completion"
|
|
|
|
end
|
2012-01-27 15:53:37 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|