You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
348 B

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