Sha256: efdd7fa9a6cd957b5069d81eea634c082c5a95edf688aa710838e8fc962f2076
Contents?: true
Size: 839 Bytes
Versions: 6
Compression:
Stored size: 839 Bytes
Contents
require 'rubygems' require 'rspec' require 'reckon' RSpec.configure do |config| config.before(:all, &:silence_output) config.after(:all, &:enable_output) def fixture_path(file) File.expand_path(File.join(File.dirname(__FILE__), "data_fixtures", file)) end end public # Redirects stderr and stout to /dev/null.txt def silence_output # Store the original stderr and stdout in order to restore them later @original_stdout = $stdout @original_stderr = $stderr # Redirect stderr and stdout $stderr = File.new(File.join(File.dirname(__FILE__), 'test_log.txt'), 'w') $stdout = $stderr Reckon::LOGGER.reopen $stderr end # Replace stderr and stdout so anything else is output correctly def enable_output $stdout = @original_stdout @original_stdout = nil $stderr = @original_stderr @original_stderr = nil end
Version data entries
6 entries across 6 versions & 1 rubygems