Skip to content

Instantly share code, notes, and snippets.

@fonsecajavier
Last active March 12, 2021 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonsecajavier/c247cd7eb55fd4ef3b92cb3bcb412146 to your computer and use it in GitHub Desktop.
Save fonsecajavier/c247cd7eb55fd4ef3b92cb3bcb412146 to your computer and use it in GitHub Desktop.
log spec (test) files that run
# 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