Open md-work opened 6 years ago
Hi, I am not actively working on this project, but if you send a PR I am happy to discuss it! More info
I think this issue should be closed.
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.
@nacengineer My problem isn't testing, but debugging (actually my tests are working great with Contracts). So please leave this ticket open.
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