Skip to content

Instantly share code, notes, and snippets.

@shiroginne
Created June 25, 2012 09:01
Show Gist options
  • Save shiroginne/2987503 to your computer and use it in GitHub Desktop.
Save shiroginne/2987503 to your computer and use it in GitHub Desktop.
.watchr simple config
def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "==> Running #{file}"
system "bundle exec rspec #{file}"
puts
puts "*" * 100
end
watch("spec/.*/*_spec.rb") do |match|
run_spec match[0]
end
watch("spec/.*/*.feature") do |match|
run_spec match[0]
end
watch("app/(.*/.*).rb") do |match|
run_spec %{spec/#{match[1]}_spec.rb}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment