Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
27 lines (21 sloc) 467 Bytes
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/lib/.*/*_spec.rb") do |match|
run_spec match[0]
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
watch("^lib/(.*/.*).rb") do |match|
run_spec %{spec/lib/#{match[1]}_spec.rb}
end
Something went wrong with that request. Please try again.