-
-
Notifications
You must be signed in to change notification settings - Fork 763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
--debug not working RSpec (2.0.0.beta.7) #24
Comments
This is a bug I ran into too. It's caused because Rsepc is actually putting it's debugger method in Object, instead of Kernel. (and Object instance methods take precedence over Kernel ones). This patch resolves the issue for me: http://github.com/timcharper/rspec-core/commit/c476e088ebabb4a89c8566be4fa07849d88271ac |
Turns out that didn't really solve the problem, but this did: http://github.com/rspec/rspec-core/commit/99727ba70461ee921fbdff5b84e514a6dca83635 |
Weird.. the patch certainly solved the problem for me. |
Tim - the experience I had was that when I had a debugger statement but did not include the -d flag, I got an undefined method error on debugger. This is because ruby-debug gets required after the kernel extensions do, so at the time the kernel extensions get loaded, the Make sense? |
What you say makes sense, but why it didn't work doesn't. I used the debugger w/out the -d flag. I have a textmate snippet that does "require 'ruby-debug'; debugger"... and it worked perfectly fine. But, at any rate, I trust your sanity, and therefore your claim that it was still broken. Thank you very much for your work on RSpec! |
I'm guessing the textmate snippet loaded ruby-debug before rspec loaded, so what you describe makes sense. Make sense? |
Unlikely, I stuck it right in the middle of an example. |
Not sure what's different in our environments but it works for me now as I expect and it didn't before. Can you do me a favor and pull the latest, build the gem and make sure it's working as you expect? |
Works just great here! Thank you. |
Great. Thanks Tim. |
also, if you are using bundler, make sure you have included the 'ruby-debugger19' under test env in your Gemfile, or it won't be included by rspec -d. |
Closes rspec#24 Motivation: ruby-debug defines its debugger method inside of the kernel module, not as an instance method of Object. By making this change, it allows one to require "ruby-debug" after rspec is loaded, and have ruby-debug's Kernel#debugger method override rspec's stub method (whereas before rspec's stub method took precedence over ruby-debug's #debugger method if ruby-debug was loaded after rspec).
Running 'rake spec' with '--debug' in my .rspec file will produce:
"debugger statement ignored, use -d or --debug option on rspec to enable debugging"
Same thing when running 'rspec -d ./spec'
Running 'rdebug rspec ./spec' works ok.
Thanks!
The text was updated successfully, but these errors were encountered: