#!/usr/bin/env bats load test_helper @test "prints usage help given no argument" { run rbenv-hooks assert_failure "Usage: rbenv hooks " } @test "prints list of hooks" { path1="${RBENV_TEST_DIR}/rbenv.d" path2="${RBENV_TEST_DIR}/etc/rbenv_hooks" RBENV_HOOK_PATH="$path1" create_hook exec "hello.bash" create_hook exec "ahoy.bash" create_hook exec "invalid.sh" create_hook which "boom.bash" RBENV_HOOK_PATH="$path2" create_hook exec "bueno.bash" RBENV_HOOK_PATH="$path1:$path2" run rbenv-hooks exec assert_success assert_output <