Last active
December 17, 2015 21:26
-
-
Save RobinDaugherty/c77135a16b126677f920 to your computer and use it in GitHub Desktop.
Rails spec cleanup
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
# Opens each model file alongside its corresponding spec file, even if the spec file doesn't yet exist. | |
# Waits for you to close the files before loading the next pair. | |
for i in app/models/**.rb; do | |
mate -w $i ${${i/app/spec}/.rb/_spec.rb} | |
done |
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
# Opens each model file alongside its corresponding spec file if the model contains "serialize". | |
# Waits for you to close the files before loading the next pair. | |
for i in app/models/**.rb; do | |
grep serialize $i && mate -w $i ${${i/app/spec}/.rb/_spec.rb} | |
done |
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
# Opens each model spec file that Rubocop has a complaint about. You can see the complaints in the output. | |
# Waits for you to close the files before loading the next pair. | |
for i in spec/models/**.rb; do | |
rubocop $i || mate -w $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment