lib/active_wrapper/db.rb in active_wrapper-0.3.3 vs lib/active_wrapper/db.rb in active_wrapper-0.3.4
- old
+ new
@@ -93,15 +93,15 @@
ActiveRecord::Base.connection.send(method, *args)
end
def redirect_stdout(&block)
if env == 'test'
- stdout = $stdout
- $stdout = File.new('/dev/null', 'w')
+ stdout = $stdout.dup
+ $stdout = $stdout.reopen(RUBY_PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")
end
yield
if env == 'test'
- $stdout = stdout
+ $stdout.reopen(stdout)
end
end
end
end
\ No newline at end of file