Created
August 31, 2012 17:42
-
-
Save thelinuxlich/3556356 to your computer and use it in GitHub Desktop.
Using Guard to automate laravel artisan test task
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
guard 'sass', :input=> 'public/sass', :output => 'public/css', :style => :compressed | |
guard 'coffeescript', :input => 'public/coffee', :output => 'public/js',:bare => true | |
module ::Guard | |
class ArtisanTest < Guard | |
def run_on_change(paths) | |
::Guard::UI.info("Running tests...") | |
::Guard::Notifier.notify("Running tests...",:title => "Laravel",:image => :pending) | |
output = `php artisan test` | |
if output =~ /FAILURE/ | |
::Guard::Notifier.notify("Some tests failed!",:title => "Laravel",:image => :failed) | |
else | |
::Guard::Notifier.notify("All tests succeeded!",:title => "Laravel",:image => :success) | |
end | |
end | |
end | |
end | |
guard 'artisan-test' do | |
watch('(.+)\.php$') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be simpler to use guard-phpunit? And if so how would you do it?
Hope you can help me with this?
Thanks.
VilliMagg