1require 'test/unit'
2require_relative '../ruby/envutil'
3
4module TestIRB
5  class TestCompletion < Test::Unit::TestCase
6    def test_nonstring_module_name
7      begin
8        require "irb/completion"
9        bug5938 = '[ruby-core:42244]'
10        cmds = %W[-rirb -rirb/completion -e IRB.setup(__FILE__)
11         -e IRB.conf[:MAIN_CONTEXT]=IRB::Irb.new.context
12         -e module\sFoo;def\sself.name;//;end;end
13         -e IRB::InputCompletor::CompletionProc.call("[1].first.")
14         -- -f --]
15        status = assert_in_out_err(cmds, "", //, [], bug5938)
16        assert(status.success?, bug5938)
17      rescue LoadError
18        skip "cannot load irb/completion"
19      end
20    end
21  end
22end
23