From 5233dbed368ec5a424b2b9ee42634ace5dc4a534 Mon Sep 17 00:00:00 2001 From: Jens Kraemer Date: Sat, 3 Sep 2016 11:10:34 +0800 Subject: [PATCH] adds basic file completion for 'rails test' command --- src/_rails | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/_rails b/src/_rails index 25e4c69..d8cc7bb 100644 --- a/src/_rails +++ b/src/_rails @@ -79,6 +79,7 @@ __rails_commands() { profiler'[Get profile information from a piece of code]' plugin'[Install a plugin]' {runner,r}'[Run a piece of code in the application environment]' + {test,t}'[Run tests]' ) else commands=( @@ -594,6 +595,24 @@ _rails_r() { _rails_runner } +_rails_test() { + local context state line curcontext="$curcontext" + + _arguments -C \ + ': :->path' + + case "$state" in + path) + _alternative \ + 'files:filename:_files -g "*.rb"' + ;; + esac +} + +_rails_t() { + _rails_test +} + _rails "$@" # Local Variables: