asdf/test/test_helpers.bash
Kevin Rockwood 0ce18100c5 Use dummy plugin in version_commands test
This adds a helper to install dummy versions. Hopefully it makes the
test setup a little easier to reason about.
2016-07-25 09:40:52 +09:00

24 lines
464 B
Bash

. $(dirname $BATS_TEST_DIRNAME)/lib/utils.sh
setup_asdf_dir() {
BASE_DIR=$(mktemp -dt asdf.XXXX)
HOME=$BASE_DIR/home
ASDF_DIR=$HOME/.asdf
mkdir -p $ASDF_DIR/plugins
mkdir -p $ASDF_DIR/installs
}
install_dummy_plugin() {
cp -r $BATS_TEST_DIRNAME/fixtures/dummy_plugin $ASDF_DIR/plugins/dummy
}
install_dummy_version() {
dummy_version=$1
mkdir -p $ASDF_DIR/installs/dummy/$dummy_version
}
clean_asdf_dir() {
rm -rf $BASE_DIR
unset ASDF_DIR
}