Sha256: 781788b2a8dcac618512c282eedc10e72736f297cb3fd545f827593597b50c5e

Contents?: true

Size: 1.67 KB

Versions: 17

Compression:

Stored size: 1.67 KB

Contents

require File.expand_path(File.dirname(__FILE__)) + '/helper.rb'

class TestRunners < Test::Unit::TestCase

  def test_solo
    file = setup_testunit(false, 'test_solo.rb')
    result = turn2 '--solo', file
    assert result.index('1 passed'),  "ACTUAL RESULT:\n #{result}"
    assert result.index('0 failures'),  "ACTUAL RESULT:\n #{result}"
    assert result.index('0 errors'), "ACTUAL RESULT:\n #{result}"
  end

  def test_cross
    file1 = setup_testunit(false, 'test1.rb')
    file2 = setup_testunit(false, 'test2.rb')
    result = turn2 '--cross', file1, file2
    assert result.index('2 passed'),  "ACTUAL RESULT:\n #{result}"
    assert result.index('0 errors'), "ACTUAL RESULT:\n #{result}"
  end

  # autorun

  #if RUBY_VERSION < '1.9'

    def test_autorun_testunit
      file = setup_testunit('turn/autorun', 'test_autorun.rb')
      result = `ruby -Ilib #{file} 2>&1`
      assert(result.index('1 passed'),  "ACTUAL RESULT:\n #{result}")
      assert(result.index('0 failures'),  "ACTUAL RESULT:\n #{result}")
      assert(result.index('0 errors'), "ACTUAL RESULT:\n #{result}")
    end

  #else

    def test_autorun
      file = setup_minitest_autorun
      result = `ruby -Ilib #{file} 2>&1`
      assert result.index('0 failures'),  "ACTUAL RESULT:\n #{result}"
      assert result.index('0 errors'), "ACTUAL RESULT:\n #{result}"
    end

    def test_autorun_with_trace
      file = setup_minitest_autorun_with_trace

      result = `ruby -Ilib #{file} 2>&1`
      assert result.index('1 failures'), 'fail is not 1'
      assert result.index('0 errors'), 'error is not 0'

      # TODO: the backtrace is empty, why?
      #assert result.scan(/\.rb:\d+:in/).length > 1
    end

  #end

end

Version data entries

17 entries across 17 versions & 5 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-1.0.0 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
swipe-rails-0.0.5 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-1.0.0.beta3 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-1.0.0.beta2 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-1.0.0.beta vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-0.9.1.beta.3 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-0.9.1.beta vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-0.9.0 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
challah-0.8.3 vendor/bundle/gems/turn-0.9.6/test/test_runners.rb
turn-0.9.6 test/test_runners.rb
challah-0.6.1 vendor/bundle/gems/turn-0.9.5/test/test_runners.rb
challah-0.6.0 vendor/bundle/gems/turn-0.9.5/test/test_runners.rb
turn-0.9.5 test/test_runners.rb
turn-0.9.4 test/test_runners.rb
turn-0.9.3 test/test_runners.rb