test/ruby: adopt newly revamped `setup()`
parent
fbf7efa1b8
commit
a36a4c4038
|
|
@ -1,24 +1,15 @@
|
|||
#!/usr/bin/env bats
|
||||
# shellcheck shell=bats
|
||||
|
||||
load ../test_helper
|
||||
load ../test_helper_libs
|
||||
load "${MAIN_BASH_IT_DIR?}/test/test_helper.bash"
|
||||
|
||||
function local_setup {
|
||||
setup_test_fixture
|
||||
|
||||
_command_exists "ruby" && mkdir -p "$(ruby -e 'print Gem.user_dir')/bin"
|
||||
|
||||
export OLD_PATH="$PATH"
|
||||
export PATH="/usr/bin:/bin:/usr/sbin"
|
||||
}
|
||||
|
||||
function local_teardown {
|
||||
export PATH="$OLD_PATH"
|
||||
unset OLD_PATH
|
||||
function local_setup_file() {
|
||||
setup_libs "helpers"
|
||||
}
|
||||
|
||||
@test "plugins ruby: remove_gem is defined" {
|
||||
load ../../plugins/available/ruby.plugin
|
||||
run load "${BASH_IT?}/plugins/available/ruby.plugin.bash"
|
||||
assert_success
|
||||
load "${BASH_IT?}/plugins/available/ruby.plugin.bash"
|
||||
|
||||
run type remove_gem
|
||||
assert_line -n 1 "remove_gem () "
|
||||
|
|
@ -31,7 +22,9 @@ function local_teardown {
|
|||
|
||||
mkdir -p "$(ruby -e 'print Gem.user_dir')/bin"
|
||||
|
||||
load ../../plugins/available/ruby.plugin
|
||||
run load "${BASH_IT?}/plugins/available/ruby.plugin.bash"
|
||||
assert_success
|
||||
load "${BASH_IT?}/plugins/available/ruby.plugin.bash"
|
||||
|
||||
local last_path_entry="$(tail -1 <<<"${PATH//:/$'\n'}")"
|
||||
[[ "${last_path_entry}" == "$(ruby -e 'print Gem.user_dir')/bin" ]]
|
||||
|
|
|
|||
Loading…
Reference in New Issue