Sha256: 735dd0bc589e93ea9c876e46cdc2cb09ba130bcb6987291ebf70406058f910cc

Contents?: true

Size: 981 Bytes

Versions: 13

Compression:

Stored size: 981 Bytes

Contents

require 'bundler/setup'
require 'simplecov'
require 'test/unit'
require 'shoulda'

SimpleCov.coverage_dir('tmp/coverage')

class Test::Unit::TestCase
  def source_fixture(filename)
    File.expand_path(File.join(File.dirname(__FILE__), 'fixtures', filename))
  end

  # Keep 1.8-rubies from complaining about missing tests in each file that covers only 1.9 functionality
  def default_test
  end
end

require 'shoulda_macros'
Test::Unit::TestCase.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

13 entries across 8 versions & 3 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/simplecov-0.9.0/test/helper.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/simplecov-0.9.0/test/helper.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/simplecov-0.9.0/test/helper.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/test/helper.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/test/helper.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/simplecov-0.8.2/test/helper.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/simplecov-0.8.2/test/helper.rb
simplecov-0.9.0 test/helper.rb
simplecov-0.8.2 test/helper.rb
simplecov-0.8.1 test/helper.rb
simplecov-0.8.0.pre2 test/helper.rb
simplecov-0.8.0.pre test/helper.rb
simplecov-0.5.2 test/helper.rb