Skip to content

Commit

Permalink
Changed some reporter tests to use FakeTest instead of loading up Run…
Browse files Browse the repository at this point in the history
…nable w/ test junk.

[git-p4: depot-paths = "//src/minitest/dev/": change = 14310]
  • Loading branch information
zenspider committed Aug 28, 2024
1 parent 20dfa7b commit e4417c5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/minitest/test_minitest_reporter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "minitest/metametameta"
require "forwardable"

class Runnable
class FakeTest < Minitest::Test
def woot
assert true
end
Expand Down Expand Up @@ -33,7 +33,7 @@ def setup

def error_test
unless defined? @et then
@et = Minitest::Test.new :woot
@et = FakeTest.new :woot
@et.failures << Minitest::UnexpectedError.new(begin
raise "no"
rescue => e
Expand All @@ -56,7 +56,7 @@ def system_stack_error_test

ex.set_backtrace ary

@sse = Minitest::Test.new :woot
@sse = FakeTest.new :woot
@sse.failures << Minitest::UnexpectedError.new(ex)
@sse = Minitest::Result.from @sse
end
Expand All @@ -65,7 +65,7 @@ def system_stack_error_test

def fail_test
unless defined? @ft then
@ft = Minitest::Test.new :woot
@ft = FakeTest.new :woot
@ft.failures << begin
raise Minitest::Assertion, "boo"
rescue Minitest::Assertion => e
Expand All @@ -77,18 +77,18 @@ def fail_test
end

def passing_test
@pt ||= Minitest::Result.from Minitest::Test.new(:woot)
@pt ||= Minitest::Result.from FakeTest.new(:woot)
end

def passing_test_with_metadata
test = Minitest::Test.new :woot
test = FakeTest.new :woot
test.metadata[:meta] = :data
@pt ||= Minitest::Result.from test
end

def skip_test
unless defined? @st then
@st = Minitest::Test.new :woot
@st = FakeTest.new :woot
@st.failures << begin
raise Minitest::Skip
rescue Minitest::Assertion => e
Expand Down Expand Up @@ -294,7 +294,7 @@ def test_report_failure
Finished in 0.00
1) Failure:
Minitest::Test#woot [FILE:LINE]:
FakeTest#woot [FILE:LINE]:
boo
1 runs, 0 assertions, 1 failures, 0 errors, 0 skips
Expand All @@ -318,7 +318,7 @@ def test_report_error
Finished in 0.00
1) Error:
Minitest::Test#woot:
FakeTest#woot:
RuntimeError: no
FILE:LINE:in 'error_test'
FILE:LINE:in 'test_report_error'
Expand All @@ -344,7 +344,7 @@ def test_report_error__sse
Finished in 0.00
1) Error:
Minitest::Test#woot:
FakeTest#woot:
SystemStackError: 274 -> 12
a
b
Expand Down Expand Up @@ -402,7 +402,7 @@ def filter.filter _bt
r.report
end

exp = "Minitest::Test#woot [foo.rb:123]"
exp = "FakeTest#woot [foo.rb:123]"

assert_includes io.string, exp
end
Expand Down

0 comments on commit e4417c5

Please sign in to comment.