mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 09:38:16 -07:00
9cac0ac50a
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`.
27 lines
577 B
Bash
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"
|
|
}
|