Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minimal test case for issue #111. Illustrates that autorun plus test …

…name filtering is not working.

Also adds a test that shows using /bin/turn and name filtering DOES work.

The failing tests show that the autorun and name filtering does not work independent of whether your tests are minitest style or minispec style.
  • Loading branch information...
commit e248bd06e7d3837d1d256f58e2d9644a92bab28d 1 parent 01bba4c
@carols10cents carols10cents authored
Showing with 45 additions and 0 deletions.
  1. +18 −0 test/helper.rb
  2. +27 −0 test/test_runners.rb
View
18 test/helper.rb
@@ -118,6 +118,24 @@ def test_sample_fail
save_test(text, 'outline_test.rb')
end
+def setup_minispec
+ text = <<-HERE
+require 'turn'
+require 'minitest/autorun'
+
+describe 'multiple tests' do
+ it 'should pass' do
+ assert true
+ end
+
+ it 'should fail' do
+ assert false
+ end
+end
+ HERE
+ save_test(text, 'minispec_test.rb')
+end
+
#
def setup_minitest_autorun
text = <<-HERE
View
27 test/test_runners.rb
@@ -18,6 +18,15 @@ def test_cross
assert result.index('0 errors'), "ACTUAL RESULT:\n #{result}"
end
+ def test_minispec_name
+ file = setup_minispec
+ result = turn2 '-n "/fail/"', file
+
+ assert result.index('0 passed'), "ACTUAL RESULT:\n #{result}"
+ assert result.index('1 failures'), "ACTUAL RESULT:\n #{result}"
+ assert result.index('1 assertions'), "ACTUAL RESULT:\n #{result}"
+ end
+
# autorun
#if RUBY_VERSION < '1.9'
@@ -30,6 +39,15 @@ def test_autorun_testunit
assert(result.index('0 errors'), "ACTUAL RESULT:\n #{result}")
end
+ def test_autorun_minispec_name
+ file = setup_minispec
+ result = `ruby -Ilib #{file} -n "/fail/" 2>&1`
+
+ assert result.index('0 passed'), "ACTUAL RESULT:\n #{result}"
+ assert result.index('1 failures'), "ACTUAL RESULT:\n #{result}"
+ assert result.index('1 assertions'), "ACTUAL RESULT:\n #{result}"
+ end
+
#else
def test_autorun
@@ -39,6 +57,15 @@ def test_autorun
assert result.index('0 errors'), "ACTUAL RESULT:\n #{result}"
end
+ def test_autorun_minitest_name
+ file = setup_minitest_autorun
+ result = `ruby -Ilib #{file} -n "/sample/" 2>&1`
+
+ assert result.index('1 passed'), "ACTUAL RESULT:\n #{result}"
+ assert result.index('1 assertions'), "ACTUAL RESULT:\n #{result}"
+ end
+
+
def test_autorun_with_trace
file = setup_minitest_autorun_with_trace
Please sign in to comment.
Something went wrong with that request. Please try again.