Skip to content

Instantly share code, notes, and snippets.

@yuriteixeira
Created March 20, 2015 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriteixeira/6bd501a1d787564d6a80 to your computer and use it in GitHub Desktop.
Save yuriteixeira/6bd501a1d787564d6a80 to your computer and use it in GitHub Desktop.
TDD Made Easy - Run tests when the files change
# TDD
function tdd {
pathToTestRunner=$1
filesToWatch=$2
if [[ -z $pathToTestRunner ]]
then
pathToTestRunner="vendor/bin/phpunit"
fi
if [[ -z $filesToWatch ]]
then
filesToWatch="./src:./lib:./tests"
fi
clear; $pathToTestRunner
fswatch $filesToWatch \
"O=$pathToTestRunner; \
clear; \
echo \"$O\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment