Permalink
Browse files

- TestCase#passed? now true if test is skipped. (qanhd)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8099]
  • Loading branch information...
1 parent 9ea4a66 commit 611d02f9da80babc729ccf61926fbbfc9785a0d4 @zenspider zenspider committed Jan 2, 2013
Showing with 12 additions and 1 deletion.
  1. +1 −1 lib/minitest/unit.rb
  2. +11 −0 test/minitest/test_minitest_unit.rb
View
2 lib/minitest/unit.rb
@@ -1302,7 +1302,7 @@ def run runner
rescue *PASSTHROUGH_EXCEPTIONS
raise
rescue Exception => e
- @passed = false
+ @passed = Skip === e
time = Time.now - start_time
runner.record self.class, self.__name__, self._assertions, time, e
result = runner.puke self.class, self.__name__, e
View
11 test/minitest/test_minitest_unit.rb
@@ -215,6 +215,17 @@ def test_omg; assert true; end
assert test.passed?
end
+ def test_passed_eh_teardown_skipped
+ test_class = Class.new MiniTest::Unit::TestCase do
+ def teardown; assert true; end
+ def test_omg; skip "bork"; end
+ end
+
+ test = test_class.new :test_omg
+ test.run @tu
+ assert test.passed?
+ end
+
def test_passed_eh_teardown_flunked
test_class = Class.new MiniTest::Unit::TestCase do
def teardown; flunk; end

0 comments on commit 611d02f

Please sign in to comment.