asdf/test/list_command.bats
Victor Borja d1f0b64c2f Remove shims on uninstall or plugin-remove
- Remove plugin shims when last version is uninstalled.
- Remove shims on plugin-remove

When the latest version of a tool is uninstalled,
Remove the plugin shims (marked with metadata at #122)

Also found lots of missing tests and added them.

Closes #67
2016-12-15 06:05:23 -06:00

30 lines
611 B
Bash

#!/usr/bin/env bats
load test_helpers
. $(dirname $BATS_TEST_DIRNAME)/lib/commands/install.sh
. $(dirname $BATS_TEST_DIRNAME)/lib/commands/list.sh
setup() {
setup_asdf_dir
install_dummy_plugin
}
teardown() {
clean_asdf_dir
}
@test "list_command should output error when plugin is not installed" {
run list_command dummy
[ "No versions installed" == "$output" ]
[ "$status" -eq 1 ]
}
@test "list_command should list installed versions" {
run install_command dummy 1.0
run install_command dummy 1.1
run list_command dummy
[ "$(echo -e "1.0\n1.1")" == "$output" ]
[ "$status" -eq 0 ]
}