box-o-sand/RubyFun/rails/gerbil/.watchr
Dan Buch 0a9428093c Add 'RubyFun/' from commit 'b01c6826131196ba58b5288a3182f2526c89c249'
git-subtree-dir: RubyFun
git-subtree-mainline: a04a502787
git-subtree-split: b01c682613
2013-01-09 23:50:14 -05:00

25 lines
348 B
Ruby

def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec #{file}"
puts
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
# vim:filetype=ruby