Skip to content

Commit

Permalink
Merge pull request #448 from jkraemer/rails-test
Browse files Browse the repository at this point in the history
adds basic file completion for 'rails test' command
  • Loading branch information
syohex committed Sep 3, 2016
2 parents 4696b8e + 5233dbe commit d04a31c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/_rails
Original file line number Diff line number Diff line change
Expand Up @@ -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=(
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit d04a31c

Please sign in to comment.