I often use the pry-byebug gem to put breakpoints in my code using
binding.pry
However, during debugging (say after making a slight change) I often want to run the entire code/spec without any breakpoints for that one time.
Is there an option to do that ?. I am looking for something like
bundle exec rspec '--ignore-pry' spec/controller/my_controller.rb
If you want to exit Pry early, you can use the '!!! ' command.
To fix this just move the binding. pry command one line to the top and try to run your file again. If it still doesn't catch it, move the binding. pry command one more line to the top and keep doing this until your file catches the binding.
TL;DR use DISABLE_PRY=1 env variable
I had exactly the same question and I found this https://github.com/pry/pry/blob/master/spec/pry_spec.rb#L29
basically you just run
DISABLE_PRY=1 bundle exec rspec spec/controller/my_controller.rb
and you're good. Tested on this vestion of pry modules
$ cat Gemfile.lock | grep pry
pry (>= 0.9.12)
pry (0.10.4)
pry-byebug (3.4.1)
pry (~> 0.10)
pry-doc (0.10.0)
pry (~> 0.9)
pry-rails (0.3.4)
pry (>= 0.9.10)
pry-rescue (1.4.4)
pry
pry-stack_explorer (0.4.9.2)
pry (>= 0.9.11)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With