Sha256: a626e22578ce000c52bbb2e1a4b40e19c1769c5f0b79af7665f7979527072d42

Contents?: true

Size: 1.67 KB

Versions: 17

Compression:

Stored size: 1.67 KB

Contents

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

class TestReporter < Turn::Reporter
end

class TestReporters < Test::Unit::TestCase
  def test_unit_test_files_are_not_filtered_out_if_ending_in_test
    reporter = TestReporter.new(nil)
    
    # If you follow the convention of naming your test files with _test.rb, do not filter that
    # test file from the stack trace
    filtered_lines = ["/Users/testman/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit/assertions.rb:185:in `assert_equal'"]
    unfiltered_lines = ["/Users/testman/source/campaign_manager/test/unit/omg_test.rb:145:in `block in <class:OmgTest>'", 
      "/Users/testman/source/campaign_manager/app/models/omg.rb:145:in `in double_rainbows'" ]
    stack_trace = filtered_lines + unfiltered_lines

    assert_equal unfiltered_lines, reporter.send(:filter_backtrace, stack_trace)
  end

  def test_unit_test_files_are_not_filtered_out_if_file_name_starts_with_test_underscore
    reporter = TestReporter.new(nil)
    
    # If you follow the convention of naming your test files with _test.rb, do not filter that
    # test file from the stack trace
    filtered_lines = ["/Users/testman/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/test/unit/assertions.rb:185:in `assert_equal'"]
    unfiltered_lines = ["/Users/testman/source/campaign_manager/test/unit/test_omgs.rb:145:in `block in <class:OmgTest>'", 
      "/Users/testman/source/campaign_manager/app/models/omg.rb:145:in `in double_rainbows'" ]
    stack_trace = filtered_lines + unfiltered_lines

    assert_equal unfiltered_lines, reporter.send(:filter_backtrace, stack_trace)
  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/reporter_test.rb
turn-0.9.7 test/reporter_test.rb
challah-1.0.0 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
swipe-rails-0.0.5 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-1.0.0.beta3 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-1.0.0.beta2 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-1.0.0.beta vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-0.9.1.beta.3 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-0.9.1.beta vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-0.9.0 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
challah-0.8.3 vendor/bundle/gems/turn-0.9.6/test/reporter_test.rb
turn-0.9.6 test/reporter_test.rb
challah-0.6.1 vendor/bundle/gems/turn-0.9.5/test/reporter_test.rb
challah-0.6.0 vendor/bundle/gems/turn-0.9.5/test/reporter_test.rb
turn-0.9.5 test/reporter_test.rb
turn-0.9.4 test/reporter_test.rb