Created
January 23, 2020 16:36
-
-
Save MatheusRich/c5b9055e8320a0aad410264a0a505b51 to your computer and use it in GitHub Desktop.
How to sort Rspec specs by file modification time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
config.register_ordering(:global) do |items| | |
items.sort_by { |item| -File.mtime(item.metadata[:absolute_file_path]).to_i } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment