Skip to content

Commit

Permalink
Added failing test to show specs can't marshal if they raise. (jeremy…
Browse files Browse the repository at this point in the history
…evans)

[git-p4: depot-paths = "//src/minitest/dev/": change = 13280]
  • Loading branch information
zenspider committed Dec 12, 2021
1 parent 0c207e3 commit 53cf9dd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/minitest/test_minitest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,25 @@ def test_spec_marshal
assert_equal @tc.failures, over_the_wire.failures
assert_equal @tc.klass, over_the_wire.klass
end

def test_spec_marshal_with_exception
klass = describe("whatever") { it("passes") { raise Class.new(StandardError)} }
rm = klass.runnable_methods.first

# Run the test
@tc = klass.new(rm).run

assert_kind_of Minitest::Result, @tc

# Pass it over the wire
over_the_wire = Marshal.load Marshal.dump @tc

assert_equal @tc.time, over_the_wire.time
assert_equal @tc.name, over_the_wire.name
assert_equal @tc.assertions, over_the_wire.assertions
assert_equal @tc.failures, over_the_wire.failures
assert_equal @tc.klass, over_the_wire.klass
end
end

class TestMinitestTest < TestMinitestRunnable
Expand Down

0 comments on commit 53cf9dd

Please sign in to comment.