Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def no_stdout
- old_stdout = $stdout
- $stdout.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
- yield
- $stdout = old_stdout
- end
- def test_whatever
- no_stdout do
- puts 'no one will ever see this'
- end
- end
Add Comment
Please, Sign In to add comment