Created
August 27, 2011 19:21
-
-
Save nickhoffman/1175763 to your computer and use it in GitHub Desktop.
A rake task for running all of the spec files that've been modified.
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
RSpec::Core::RakeTask.new('spec:changed') do |t| | |
changed_files = `git status -s | grep '^ M spec/' | grep '_spec.rb$'`.split "\n" | |
changed_files.each {|file| file.sub! /\A M /, '' } | |
puts | |
puts "Found #{changed_files.count} changed spec file(s):" | |
changed_files.each {|file| puts " #{file}"} | |
puts | |
t.pattern = changed_files | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment