spec/spec_helper.rb in saviour-0.2.2 vs spec/spec_helper.rb in saviour-0.2.3
- old
+ new
@@ -19,10 +19,22 @@
end
ActiveRecord::Base.establish_connection(connection_opts)
ActiveRecord::Base.logger = Logger.new(STDOUT) if ENV['DEBUG']
+
+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)
+ old_stream.close
+end
+
silence_stream(STDOUT) { require 'support/schema' }
+
require 'support/models'
RSpec.configure do |config|
config.around do |example|
Fog.mock!