From 5832f20aec7f60e229a567fac98808bb757379af Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 18 Jun 2021 22:10:46 -0400 Subject: [PATCH] Hack in some more ruby test running --- zsh/.functions | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/zsh/.functions b/zsh/.functions index 54481b8..3891b7c 100644 --- a/zsh/.functions +++ b/zsh/.functions @@ -111,9 +111,19 @@ function stopwatch { function test-rails { if bundle exec rspec --help > /dev/null 2>&1; then - bundle exec rspec $@ - else + if [ -d spec ]; then + bundle exec rspec $@ + else + ruby *_test.rb + fi + elif bundle exec rails version > /dev/null 2>&1; then bundle exec rails test $@ + else + if [[ $# > 0 ]]; then + ruby $@ + else + ruby *_test.rb + fi fi }