You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simply doing ENV['NO_CONTRACTS'] = '1' doesn't work. Looks like that variable is only evaluated at start, when Ruby goes through Contract ... def method_a ....
I know I could set a breakpoint, but it's not always clear where a method call goes (think of polymorphism) And I know I can use the NO_CONTRACTS environment variable. But sadly that's not always a practical solution.
I think the bulk of your difficulty is arising more as a result of your testing methods. I believe you could add rspec to this project and leverage it to alleviate a lot of the pain you may be experiencing while using rdebug.
For example, with rspec, you could isolate the method of code you're testing in some unit tests and stub the NO_CONTRACTS constant when you need it to be off.
When debugging code, I need to go trough all the Contracts code when stepping into a method guarded by a Contract.
Example:
Is there any way to hide the Contracts code when stepping into a method?
Maybe something about breakpoints!?
Or maybe there could be a global (not environment) variable to disable contracts, which can be manually set before stepping into a method. E.g.:
Simply doing
ENV['NO_CONTRACTS'] = '1'
doesn't work. Looks like that variable is only evaluated at start, when Ruby goes throughContract ... def method_a ...
.Same problem for the byebug debugger. (https://github.com/deivid-rodriguez/byebug)
I know I could set a breakpoint, but it's not always clear where a method call goes (think of polymorphism) And I know I can use the NO_CONTRACTS environment variable. But sadly that's not always a practical solution.
Maybe related: #276
The text was updated successfully, but these errors were encountered: