Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: regex validate plugin names on plugin add cmd #1010

Merged
merged 9 commits into from Jul 29, 2021
6 changes: 3 additions & 3 deletions test/plugin_update_command.bats
Expand Up @@ -21,7 +21,7 @@ teardown() {
}

@test "asdf plugin-update should pull latest default branch (refs/remotes/origin/HEAD) for plugin even if default branch changes" {
install_mock_plugin_repo "dummy-remote"
install_mock_plugin_repo "dummy"
remote_dir="$BASE_DIR/repo-dummy-remote"
# set HEAD to refs/head/main in dummy-remote
git -C "${remote_dir}" checkout -b main
Expand All @@ -39,7 +39,7 @@ teardown() {
}

@test "asdf plugin-update should pull latest default branch (refs/remotes/origin/HEAD) for plugin even if the default branch contains a forward slash" {
install_mock_plugin_repo "dummy-remote"
install_mock_plugin_repo "dummy"
remote_dir="$BASE_DIR/repo-dummy-remote"
# set HEAD to refs/head/my/default in dummy-remote
git -C "${remote_dir}" checkout -b my/default
Expand All @@ -62,7 +62,7 @@ teardown() {
run asdf plugin-update dummy "${current_sha}"

# setup mock plugin remote
install_mock_plugin_repo "dummy-remote"
install_mock_plugin_repo "dummy"
remote_dir="$BASE_DIR/repo-dummy-remote"
# set HEAD to refs/head/main in dummy-remote
git -C "${remote_dir}" checkout -b main
Expand Down
2 changes: 1 addition & 1 deletion test/test_helpers.bash
Expand Up @@ -46,7 +46,7 @@ install_mock_broken_plugin() {
install_mock_plugin_repo() {
local plugin_name=$1
local location="${BASE_DIR}/repo-${plugin_name}"
cp -r "$BATS_TEST_DIRNAME/fixtures/dummy_plugin" "${location}"
jthegedus marked this conversation as resolved.
Show resolved Hide resolved
cp -r "$BATS_TEST_DIRNAME/fixtures/${plugin_name}_plugin" "${location}"
git -C "${location}" init -q
git -C "${location}" config user.name "Test"
git -C "${location}" config user.email "test@example.com"
Expand Down