Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Last active December 15, 2015 21:38
Show Gist options
  • Save phcostabh/5326649 to your computer and use it in GitHub Desktop.
Save phcostabh/5326649 to your computer and use it in GitHub Desktop.
Autotesting in Laravel 3 with Watchr
watch("application/tests/.*.test.php") do |match|
run_test match[0]
end
def run_test(file)
unless File.exists?(file)
puts "#{file} dos not exist"
return
end
clear_console
puts "Running #{file}"
result = `phpunit --bootstrap laravel/cli/task/test/phpunit.php #{file}`
puts result
end
def clear_console
puts "\e\H\e[2J" # clear console
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment