asdf/test/plugin_commands.bats

30 lines
706 B
Plaintext
Raw Normal View History

#!/usr/bin/env bats
load test_helpers
. $(dirname $BATS_TEST_DIRNAME)/lib/commands/plugin-add.sh
. $(dirname $BATS_TEST_DIRNAME)/lib/commands/plugin-list.sh
setup() {
setup_asdf_dir
}
teardown() {
clean_asdf_dir
}
@test "plugin_add command with no URL specified adds a plugin using repo" {
run plugin_add_command "elixir"
[ "$status" -eq 0 ]
run plugin_list_command
2018-01-13 21:50:49 -07:00
# whitespace between 'elixir' and url is from printf %-15s %s format
[ "$output" = "elixir" ]
}
2017-07-25 17:03:30 -07:00
@test "plugin_add command with no URL specified fails if the plugin doesn't exist" {
run plugin_add_command "does-not-exist"
[ "$status" -eq 1 ]
echo "$output" | grep "plugin does-not-exist not found in repository"
}