Sha256: 5cb11f615a3412288c92f136b36fbc7b40d9232b2782f80bc585361d5395a5c1

Contents?: true

Size: 1.06 KB

Versions: 63

Compression:

Stored size: 1.06 KB

Contents

require 'helper'

# Make sure that exit codes of tests are propagated properly when using
# simplecov. See github issue #5
class TestReturnCodes < Test::Unit::TestCase
  on_ruby '1.8', '1.9' do
    context "Inside fixtures/frameworks" do
      setup do
        @current_dir = Dir.getwd
        Dir.chdir(File.join(File.dirname(__FILE__), 'fixtures', 'frameworks'))
        FileUtils.rm_rf('./coverage')
      end

      should "have return code 0 when running testunit_good.rb" do
        `ruby testunit_good.rb`
        assert_equal 0, $?.exitstatus
      end

      should "have return code 0 when running rspec_good.rb" do
        `rspec rspec_good.rb`
        assert_equal 0, $?.exitstatus
      end

      should "have non-0 return code when running testunit_bad.rb" do
        `ruby testunit_bad.rb`
        assert_not_equal 0, $?.exitstatus
      end

      should "have return code 1 when running rspec_bad.rb" do
        `rspec rspec_bad.rb`
        assert_not_equal 0, $?.exitstatus
      end

      teardown do
        Dir.chdir(@current_dir)
      end
    end
  end
end

Version data entries

63 entries across 48 versions & 6 rubygems

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