asdf/test/plugin_commands.bats
jthegedus f99bdc75c0 add --urls flag for asdf list-plugins
Fixed tests due to use of printf
2018-01-14 19:38:00 +11:00

30 lines
706 B
Bash

#!/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
# whitespace between 'elixir' and url is from printf %-15s %s format
[ "$output" = "elixir" ]
}
@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"
}