Sha256: fc414befe574ae14bdf0d6a9c31b23d6dad16d617081eb5a70b27310b150d5d0
Contents?: true
Size: 814 Bytes
Versions: 9
Compression:
Stored size: 814 Bytes
Contents
require 'bundler/setup' require 'simplecov' require 'minitest/autorun' require 'shoulda' SimpleCov.coverage_dir('tmp/coverage') def source_fixture(filename) File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', filename)) end require 'shoulda_macros' Minitest::Test.send :extend, ShouldaMacros # Taken from http://stackoverflow.com/questions/4459330/how-do-i-temporarily-redirect-stderr-in-ruby require 'stringio' def capture_stderr # The output stream must be an IO-like object. In this case we capture it in # an in-memory IO object so we can return the string value. You can assign any # IO object here. previous_stderr, $stderr = $stderr, StringIO.new yield $stderr.string ensure # Restore the previous value of stderr (typically equal to STDERR). $stderr = previous_stderr end
Version data entries
9 entries across 8 versions & 2 rubygems