Skip to content

Commit

Permalink
use file base name if available for minitest
Browse files Browse the repository at this point in the history
  • Loading branch information
stephsachrajda committed Jan 4, 2024
1 parent b4d3f39 commit 4a6dbac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/deprecation_toolkit/read_write_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 4a6dbac

Please sign in to comment.