This repository has been archived on 2021-07-13. You can view files and clone it, but cannot push or open issues or pull requests.
feedfu/.watchr
Aaron Mueller 9ea67909cc Replace the ruby unit testing framework with rspec
Add watchr and spork to speed up the test run. Please note that spork
and watchr needs to start up separately. (See Gemfile for more
information)
2012-06-06 22:41:31 +02:00

19 lines
346 B
Ruby

def run_spec(file)
unless File.exists?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec --format documentation #{file}"
puts "*"*72
end
watch("spec/.*/*_spec.rb") do |match|
run_spec(match[0])
end
watch("app/(.*/.*).rb") do |match|
run_spec %{spec/#{match[1]}_spec.rb}
end