Last active
February 17, 2021 02:24
-
-
Save mitsuhirookuno/ab385cdf1f29909ee2aeee0f1ee6a0c9 to your computer and use it in GitHub Desktop.
対応するrspecに漏れがないかチェッカー
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
def main | |
@class_files = Dir.glob("app/loyalties/**/*.rb") | |
@rspec_files = Dir.glob("spec/loyalties/**/*.rb") | |
@class_files.each do |class_file| | |
rspec_file = class_file.gsub(/\Aapp/, 'spec').gsub(/loyalty.rb\z/, 'loyalty_spec.rb') | |
next if @rspec_files.include?(rspec_file) | |
next if class_file == 'app/loyalties/application_loyalty.rb' | |
puts "#{class_file} のテストが無いよ #{rspec_file}だよ" | |
end | |
end | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment