Skip to content

Instantly share code, notes, and snippets.

@jamband
Created January 15, 2013 11:21
Show Gist options
  • Save jamband/4537971 to your computer and use it in GitHub Desktop.
Save jamband/4537971 to your computer and use it in GitHub Desktop.
Yii + PHPUnit + watchr (growlなし)
$exec = "phpunit"
watch('models/(.*).php') { |m| changed(m[0]) }
watch('tests/unit/(.*)Test.php') { |m| changed(m[0]) }
def changed(file)
# pathは人それぞれ
path = "/Users/xxx/Dropbox/htdocs/hoge/protected/tests/"
run "cd #{path} && #{$exec} unit/"
end
def run(cmd)
result = `#{cmd}`
puts result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment