Skip to content

jamoore5/learning_exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Test && Commit || Revert

Blog introducing TCR

I am using a variant of TCR that only reverts when I change none test files. That way I can use use TDD and get the benefits of the red-green-refactor cycle.

Here are the bash functions I am using

function only_test_changes() { if [ "$(git status | grep -c lib)" -eq 0 ]; then echo 'only test changes'; else false; fi; }

function tcr() { rake test && (git add . && git commit -m "working code") || only_test_changes || git reset --hard; }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published