Skip to content

Instantly share code, notes, and snippets.

@kyle-annen
Created April 30, 2019 16:54
Show Gist options
  • Save kyle-annen/4d833d38fe6581c5743a8ecad0b4a51c to your computer and use it in GitHub Desktop.
Save kyle-annen/4d833d38fe6581c5743a8ecad0b4a51c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
file_with_failure = "spec/folder/flaky_spec.rb"
spec_files = Dir["spec/folder/**/*_spec.rb"]
.reject {|file| file == file_with_failure}
spec_files.each do |spec_file|
command = “rspec spec --order defined”
result = system("#{command} #{spec_file} #{file_with_failure}"
result = {outcome: outcome, first_file: spec_file}
File.open("tmp/spec_order.log", "a"){ |file| file.puts result }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment