From 4a6dbacee2128b6929f81a1bae5df02aa083bc10 Mon Sep 17 00:00:00 2001 From: stephsachrajda Date: Wed, 3 Jan 2024 16:52:08 -0700 Subject: [PATCH] use file base name if available for minitest --- lib/deprecation_toolkit/read_write_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/deprecation_toolkit/read_write_helper.rb b/lib/deprecation_toolkit/read_write_helper.rb index 55b0fc0..30e7c58 100644 --- a/lib/deprecation_toolkit/read_write_helper.rb +++ b/lib/deprecation_toolkit/read_write_helper.rb @@ -52,7 +52,12 @@ def recorded_deprecations_path(test) if DeprecationToolkit::Configuration.test_runner == :rspec test.example_group.file_path.sub(%r{^./spec/}, "").sub(/_spec.rb$/, "") else - test.class.name.underscore + test_path = test_location(test) + if test_path == "unknown" + test.class.name.underscore + else + File.dirname(test.class.name.underscore) + "/" + File.basename(test_path, ".*") + end end Pathname(deprecation_folder).join("#{path}.yml")