spec/spec_helper.rb in beatport-0.1.2 vs spec/spec_helper.rb in beatport-0.1.3
- old
+ new
@@ -14,6 +14,15 @@
require 'pp'
require 'log_buddy'
RSpec.configure do |config|
# some (optional) config here
+end
+
+def silence_stream(stream)
+ old_stream = stream.dup
+ stream.reopen(RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ ? 'NUL:' : '/dev/null')
+ stream.sync = true
+ yield
+ensure
+ stream.reopen(old_stream)
end
\ No newline at end of file