Last active
December 15, 2015 21:38
-
-
Save phcostabh/5326649 to your computer and use it in GitHub Desktop.
Autotesting in Laravel 3 with Watchr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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