thanks for the help.


On 11 December 2013 16:38, 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 = {}")
>
> push the commit to your branch and this pull request will update. no need
> for a new one.
> it was failing because #[] is an instance method on a class but we didn't
> create an instance from the class.
> adding .new does the trick.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/pry/pry/pull/1039/files#r8263002>
> .
>