Skip to content

Instantly share code, notes, and snippets.

@lmarburger
Forked from powellnathanj/gist:346482
Created March 28, 2010 18:44
Show Gist options
  • Save lmarburger/346950 to your computer and use it in GitHub Desktop.
Save lmarburger/346950 to your computer and use it in GitHub Desktop.
exec_last_feature_or_test(){
history|sort -r|sed -s 's/^ [0-9]* //'|while read i;do if [[ "$i" =~ ^ruby || "$i" =~ ^cucumber ]];then echo $i|sh;exit;fi;done
}
$ exec_last_feature_or_test
Loaded suite test/unit/item_test
Started
stty: stdin isn't a terminal
Item
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
23 tests: all passed
$ ruby -Itest test/unit/item_test.rb
Loaded suite test/unit/item_test
Started
Item .......................
23 tests: all passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment