Permalink
Browse files

- Quiet the output of all system() calls. This makes test runs much less

  noisy
  • Loading branch information...
1 parent 0771de9 commit a41270866f457acaf52b09b617af69583621a293 @jordansissel committed Dec 7, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 spec/spec_setup.rb
View
@@ -23,3 +23,18 @@
spec_logger.subscribe(STDOUT)
spec_logger.level = :warn
+# Quiet the output of all system() calls
+module Kernel
+ alias_method :orig_system, :system
+ def system(*args)
+ old_stdout = $stdout.clone
+ old_stderr = $stderr.clone
+ null = File.new("/dev/null", "w")
+ $stdout.reopen(null)
+ $stderr.reopen(null)
+ orig_system(*args)
+ $stdout.reopen(old_stdout)
+ $stderr.reopen(old_stderr)
+ null.close
+ end
+end

0 comments on commit a412708

Please sign in to comment.