2011-08-17 00:53:20 -04:00
|
|
|
require 'helper'
|
|
|
|
|
|
|
|
describe Pry::InputCompleter do
|
|
|
|
|
|
|
|
before do
|
|
|
|
# The AMQP gem has some classes like this:
|
|
|
|
# pry(main)> AMQP::Protocol::Test::ContentOk.name
|
|
|
|
# => :content_ok
|
|
|
|
module SymbolyName
|
|
|
|
def self.name; :symboly_name; end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
after do
|
|
|
|
Object.remove_const :SymbolyName
|
|
|
|
end
|
|
|
|
|
2011-09-06 13:20:04 -04:00
|
|
|
# another jruby hack :((
|
|
|
|
if !jruby?
|
|
|
|
it "should not crash if there's a Module that has a symbolic name." do
|
|
|
|
completer = Pry::InputCompleter.build_completion_proc(Pry.binding_for(Object.new))
|
|
|
|
lambda{ completer.call "a.to_s." }.should.not.raise Exception
|
|
|
|
end
|
2011-08-17 00:53:20 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|