Last active
December 15, 2020 09:21
-
-
Save pirj/0604fa90fb6a21849e6d to your computer and use it in GitHub Desktop.
Locate those annoying MESSages during tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in your test helper | |
# Use `caller` to locate where in code that BUGGER is | |
class IO | |
BUGGER = /annoying/ | |
def print *args | |
binding.pry if args.any? { |arg| arg =~ BUGGER } | |
super *args | |
end | |
def puts *args | |
binding.pry if args.any? { |arg| arg =~ BUGGER } | |
super *args | |
end | |
def warn *args | |
binding.pry if args.any? { |arg| arg =~ BUGGER } | |
super *args | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment