rubyforgood/casa

View on GitHub
scripts/generate_github_issues_for_missing_spec.rb

Summary

Maintainability
A
0 mins
Test Coverage
# for every xit test
Dir.glob("spec/**/*spec.rb").each do |filename|
  File.open(filename, "r").readlines.select { |line| line.include?("xit \"") }.each do |xit_line|
    line_number = $.
    clean_test_name = xit_line.gsub("xit ", "").gsub(" do\n", "").delete('"').delete("\n").strip
    # clean_test_name = xit_line.gsub('xit', '').gsub('\"do.*', '').gsub('"', '').gsub("\n", '').strip
    title = "Fix or remove xit-ignored test in #{filename}:#{line_number} '#{clean_test_name}'"
    `gh issue create --title "#{title}" --body "#{title}"`
  end
end; nil