Skip to content

Commit 55ad48a

Browse files
committed
- Reorder Minitest::Test.ancestors to allow reaching Minitest::Assertions#skipped? (Edouard-chin)
[git-p4: depot-paths = "//src/minitest/dev/": change = 14407]
1 parent 06bae5b commit 55ad48a

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

lib/minitest/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ module Minitest
99

1010
class Test < Runnable
1111
require "minitest/assertions"
12-
include Minitest::Assertions
1312
include Minitest::Reportable
13+
include Minitest::Assertions
1414

1515
def class_name # :nodoc:
1616
self.class.name # for Minitest::Reportable

test/minitest/test_minitest_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,24 @@ def test_omg; assert true; end
157157
refute_predicate test, :skipped?
158158
end
159159

160+
def test_skipped_is_reachable
161+
test_class = Class.new FakeNamedTest do
162+
def test_omg
163+
skip
164+
ensure
165+
flunk unless skipped?
166+
end
167+
end
168+
169+
test = test_class.new :test_omg
170+
test.run
171+
172+
refute_predicate test, :error?
173+
refute_predicate test, :passed?
174+
175+
assert_predicate test, :skipped?
176+
end
177+
160178
def util_expand_bt bt
161179
bt.map { |f| f.start_with?(".") ? File.expand_path(f) : f }
162180
end

0 commit comments

Comments
 (0)