You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rubygem-activesupport/rubygem-activesupport-5.1.4...

40 lines
1.6 KiB

From 3a077f369199651fa62a3e9b8ab2d8f8ee70a0e9 Mon Sep 17 00:00:00 2001
From: "yuuji.yaginuma" <yuuji.yaginuma@gmail.com>
Date: Tue, 2 Jan 2018 18:15:11 +0900
Subject: [PATCH] Use `Minitest::Result` for retain test result
Runnable.marshal_dump/load was removed in
https://github.com/seattlerb/minitest/commit/00433fc0a4fdd0e6b302aace633384ba1312237
Instead, `Minitest::Result` is contained test result and the that can be
marshalled.
---
activesupport/lib/active_support/testing/isolation.rb | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb
index fa9bebb181a4..562f985f1ba2 100644
--- a/activesupport/lib/active_support/testing/isolation.rb
+++ b/activesupport/lib/active_support/testing/isolation.rb
@@ -45,7 +45,8 @@ def run_in_isolation(&blk)
end
}
end
- result = Marshal.dump(dup)
+ test_result = defined?(Minitest::Result) ? Minitest::Result.from(self) : dup
+ result = Marshal.dump(test_result)
end
write.puts [result].pack("m")
@@ -69,8 +70,9 @@ def run_in_isolation(&blk)
if ENV["ISOLATION_TEST"]
yield
+ test_result = defined?(Minitest::Result) ? Minitest::Result.from(self) : dup
File.open(ENV["ISOLATION_OUTPUT"], "w") do |file|
- file.puts [Marshal.dump(dup)].pack("m")
+ file.puts [Marshal.dump(test_result)].pack("m")
end
exit!
else