Sha256: 8418622e955c772cfc459177ae546686e81300a03b0e40f8129ba26c1dd016d7

Contents?: true

Size: 982 Bytes

Versions: 44

Compression:

Stored size: 982 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

44 entries across 34 versions & 6 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/simplecov-0.7.1/test/helper.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/simplecov-0.7.1/test/helper.rb
challah-1.0.0 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-1.0.0.beta3 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/simplecov-0.7.1/test/helper.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/simplecov-0.7.1/test/helper.rb
challah-1.0.0.beta2 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-1.0.0.beta vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-0.9.1.beta.3 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
devise_sociable-0.1.0 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-0.9.1.beta vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-0.9.0 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/simplecov-0.6.4/test/helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/simplecov-0.6.4/test/helper.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/simplecov-0.6.4/test/helper.rb
challah-0.8.3 vendor/bundle/gems/simplecov-0.6.4/test/helper.rb
challah-0.8.3 vendor/bundle/gems/simplecov-0.7.1/test/helper.rb
simplecov-0.7.1 test/helper.rb