diff --git a/completion-gem b/completion-gem index e8dd330..06d3d9f 100644 --- a/completion-gem +++ b/completion-gem @@ -64,7 +64,7 @@ __gem() { return;; uninstall | cleanup) choices=$(__gem_installed_gems);; - push) + push | unpack) type -t _filedir >/dev/null && _filedir gem return;; esac diff --git a/tests/completion-gem/test.sh b/tests/completion-gem/test.sh index 5e8e594..fcecdf4 100755 --- a/tests/completion-gem/test.sh +++ b/tests/completion-gem/test.sh @@ -70,3 +70,15 @@ begin-test 'should offer command-specific options' reject --strict ) end-test + +begin-test 'after unpack should suggest local .gem files' +( + touch foo.rb foo.gem foo.gemspec + + test-completion gem unpack f + expect foo.gem + reject foo.rb foo.gemspec + + rm -f foo.rb foo.gem foo.gemspec +) +end-test