NoMethodError: undefined method `name' for nil:NilClass
    spec/method_spec.rb:81:in `block (3 levels) in <top (required)>':
.from_str - should take care of cases like $ mongo[] - issue 998
    spec/method_spec.rb:77:in `block (2 levels) in <top (required)>'
    spec/method_spec.rb:10:in `block in <top (required)>'
    spec/method_spec.rb:4:in `<top (required)>'

/home/deepender/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:14:in
`eval'

/home/deepender/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:14:in
`<main>


On 11 December 2013 16:14, Robert <notifications@github.com> wrote:

> In spec/method_spec.rb:
>
> >        klass = Class.new { def hello; :hello; end }
> >        meth = Pry::Method.from_str("klass.new.hello", Pry.binding_for(binding))
> >        meth.name.should == "hello"
> >      end
> >
> > +    it 'should take care of corner cases like mongo[] e.g Foo::Bar.new[]- issue 998' do
> > +      klass = Class.new { def []; :hello; end }
> > +      meth = Pry::Method.from_str("klass.new[]", Pry.binding_for(binding))
> > +      meth.name.should == "[]"
> > +    end
> > +
> > +    it 'should take care of cases like $ mongo[] - issue 998' do
> > +      f = Class.new { def []; :hello; end }
> > +      binding.eval("f = {}")
>
> what is the error?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pry/pry/pull/1039/files#r8262504>
> .
>