Skip to content

Commit

Permalink
- Support new Proc#to_s format. (ko1)
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//src/minitest/dev/": change = 12346]
  • Loading branch information
zenspider committed Oct 19, 2019
1 parent 15ed8e4 commit 2716a85
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions test/minitest/test_minitest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ def assert_triggered expected = "blah", klass = Minitest::Assertion

msg = e.message.sub(/(---Backtrace---).*/m, '\1')
msg.gsub!(/\(oid=[-0-9]+\)/, "(oid=N)")
msg.gsub!(/@.+>/, "@PATH>")
msg.gsub!(/(\d\.\d{6})\d+/, '\1xxx') # normalize: ruby version, impl, platform
msg.gsub!(/:0x[a-fA-F0-9]{4,}/m, ":0xXXXXXX")
msg.gsub!(/:0x[Xa-fA-F0-9]{4,}[ @].+?>/, ":0xXXXXXX@PATH>")

if expected
@assertion_count += 1
Expand Down Expand Up @@ -213,7 +212,7 @@ def assert_triggered expected = "blah", klass = Minitest::Assertion
_(6 * 9).must_equal 42, "msg"
end

assert_triggered(/^-42\n\+#<Proc:0xXXXXXX@PATH>\n/) do
assert_triggered(/^-42\n\+#<Proc:0xXXXXXX[ @]PATH>\n/) do
_(proc { 42 }).must_equal 42 # proc isn't called, so expectation fails
end
end
Expand Down

0 comments on commit 2716a85

Please sign in to comment.