Last active
March 12, 2021 12:58
-
-
Save fonsecajavier/c247cd7eb55fd4ef3b92cb3bcb412146 to your computer and use it in GitHub Desktop.
log spec (test) files that run
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| | |
# ... | |
$spec_files = Set.new | |
config.before(:each) do |example| | |
$spec_files << example.metadata[:file_path] | |
end | |
# keep logging each run spec file in spec_files.txt | |
config.after(:all) do | |
File.open("spec_files.txt", "w+") do |f| | |
f.puts $spec_files.to_a.join(" ") | |
end | |
end | |
# print all spec files in the summary report inside the terminal | |
config.after(:suite) do | |
puts "Spec files: ", $spec_files.to_a.join(" ") | |
end | |
# ... | |
# end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment