Created
December 13, 2010 16:34
-
-
Save johnbintz/739193 to your computer and use it in GitHub Desktop.
Run rcov with RSpec tests from the command line
This file contains hidden or 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 rcov(file = nil) | |
file = Dir['spec/**/*_spec.rb'].join(' ') if !file | |
system %{bundle exec ruby -Ilib -S rcov -x '/gems/,config/,spec/' -t $(which rspec) -- #{file}} | |
end | |
watch('app/(.*/.*)\.rb') { |m| rcov("spec/#{m[1]}_spec.rb") } | |
watch('spec/(.*/.*)_spec\.rb') { |m| rcov(m[0]) } | |
rcov |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment