Skip to content
This repository

Pry step function namespace collision with cucumber #14

Open
daveroberts opened this Issue June 04, 2012 · 5 comments

4 participants

Dave Roberts Matt Wynne John Mair Gopal Patel
Dave Roberts

Pry's step function has a namespace collision with cucumber's step function. Calling step when inside a binding pry from within cucumber causes an infinite loop. Setting an alias doesn't help. Perhaps in addition to alias, there should be a rename?

Matt Wynne

We've logged this in Cucumber here. I'm over here to see how I can help.

It seems to me that there should be a way for pry-nav to add its commands into the context of the REPL session without stomping on the methods of the class it's debugging, but that's just my first impression :)

How can we best solve this?

John Mair
Collaborator

@daveroberts The current ways to resolve a command/method collision aren't sufficient?

  1. Prepend a space before typing step (this will invoke the RSpec step)
  2. You can turn on Pry.config.command_prefixthis will require you to type %step (typically) before the pry-nav step command is invoked.
  3. You can manually rename step yourself in your .pryrc, i.e `Pry.commands.rename "my-step", "step"
Gopal Patel
Owner
nixme commented June 04, 2012

I don't understand how it causes an infinite loop. Either pry-nav's step gets invoked or cucumber's. If there's an infinite loop, besides the naming conflict, there might also be a bug in pry-nav's step?

Do you no longer get the infinite looping if you rename the step command like @banister showed in option 3?

Dave Roberts

I'm unable to reproduce this in a stripped down Rails environment, and I can't share the source for the project this is occurring in. If I can reproduce in a smaller environment I'll revisit this issue.

Gopal Patel
Owner
nixme commented June 12, 2012

@mattwynne @daveroberts Somewhat unrelated to this issue, but I've rewritten pry-nav with a different tracing mechanism and additional features. I encourage you to try it out: https://github.com/nixme/pry-debugger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.