Last active
November 13, 2016 15:36
-
-
Save Insti/5b3fb27f66ebd2e1e7887a3d97eb049c to your computer and use it in GitHub Desktop.
Guardfile for running Exercism (Ruby) tests.
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
# Guardfile to run Exercism Ruby tests. | |
# gem install guard | |
# gem install guard-shell | |
# Run with 'guard' command from your base exercism directory. | |
interactor :off | |
guard :shell do | |
watch(/(.*).rb/) do |m| | |
file = m[0] | |
test_file = file[/_test\.rb/] ? file : file.sub(/\.rb/, '_test.rb') | |
command = "ruby #{test_file} && rubocop -D #{file} #{test_file}" | |
system(command) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment