asdf/test/plugin_commands.bats
Victor Hugo Borja 9cac0ac50a Faster exec times. Load commands only when nedded.
When testing, use `run asdf` to actually test the command
as the user would invoke it, so that we might catch possible
errors on `bin/asdf`.
2019-01-20 02:13:20 -06:00

27 lines
577 B
Bash

#!/usr/bin/env bats
load test_helpers
setup() {
setup_asdf_dir
}
teardown() {
clean_asdf_dir
}
@test "plugin_add command with no URL specified adds a plugin using repo" {
run asdf plugin-add "elixir"
[ "$status" -eq 0 ]
run asdf plugin-list
# 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 asdf plugin-add "does-not-exist"
[ "$status" -eq 1 ]
echo "$output" | grep "plugin does-not-exist not found in repository"
}