#!/usr/bin/env bats load test_helper create_command() { bin="${RBENV_TEST_DIR}/bin" mkdir -p "$bin" echo "$2" > "${bin}/$1" chmod +x "${bin}/$1" } @test "command with no completion support" { create_command "rbenv-hello" "#!$BASH echo hello" run rbenv-completions hello assert_success "--help" } @test "command with completion support" { create_command "rbenv-hello" "#!$BASH # Provide rbenv completions if [[ \$1 = --complete ]]; then echo hello else exit 1 fi" run rbenv-completions hello assert_success assert_output <