2018-10-19 19:44:26 -07:00
|
|
|
#!/usr/bin/env bats
|
|
|
|
|
|
|
|
load test_helpers
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
setup_asdf_dir
|
2021-11-07 15:40:53 -07:00
|
|
|
install_mock_plugin_repo "dummy"
|
2018-10-19 19:44:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
teardown() {
|
|
|
|
clean_asdf_dir
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plugin_test_command with no URL specified prints an error" {
|
2024-12-09 18:43:23 -07:00
|
|
|
run asdf plugin test "elixir"
|
2018-10-19 19:44:26 -07:00
|
|
|
[ "$status" -eq 1 ]
|
|
|
|
[ "$output" = "FAILED: please provide a plugin name and url" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plugin_test_command with no name or URL specified prints an error" {
|
2024-12-09 18:43:23 -07:00
|
|
|
run asdf plugin test
|
2018-10-19 19:44:26 -07:00
|
|
|
[ "$status" -eq 1 ]
|
|
|
|
[ "$output" = "FAILED: please provide a plugin name and url" ]
|
|
|
|
}
|
2021-11-07 15:40:53 -07:00
|
|
|
|
|
|
|
@test "plugin_test_command works with no options provided" {
|
2024-12-09 18:43:23 -07:00
|
|
|
run asdf plugin test dummy "${BASE_DIR}/repo-dummy"
|
2021-11-07 15:40:53 -07:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|
|
|
|
|
|
|
|
@test "plugin_test_command works with all options provided" {
|
2024-12-09 18:43:23 -07:00
|
|
|
run asdf plugin test dummy "${BASE_DIR}/repo-dummy" --asdf-tool-version 1.0.0 --asdf-plugin-gitref master
|
2021-11-07 15:40:53 -07:00
|
|
|
[ "$status" -eq 0 ]
|
|
|
|
}
|