Avoid magic prefix parsing
This commit is contained in:
@@ -25,7 +25,7 @@ RSpec.describe AzureDevops::Audit do
|
||||
ISSUE
|
||||
end
|
||||
|
||||
it { is_expected.to eq(["--azure-devops-organization", "my-organization"]) }
|
||||
it { is_expected.to eq([["--azure-devops-organization", "my-organization"]]) }
|
||||
end
|
||||
|
||||
context "when issue_content contains a project" do
|
||||
@@ -36,7 +36,7 @@ RSpec.describe AzureDevops::Audit do
|
||||
ISSUE
|
||||
end
|
||||
|
||||
it { is_expected.to eq(["--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project"]) }
|
||||
it { is_expected.to eq([["--azure-devops-organization", "my-organization"], ["--azure-devops-project", "my-project"]]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,13 +16,13 @@ RSpec.describe AzureDevops::DryRun do
|
||||
context "when the comment body does not contain a pipeline type" do
|
||||
let(:comment_body) { "/dry-run" }
|
||||
|
||||
it { is_expected.to eq(["pipeline", "--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project"]) }
|
||||
it { is_expected.to eq(["pipeline", ["--azure-devops-organization", "my-organization"], ["--azure-devops-project", "my-project"]]) }
|
||||
end
|
||||
|
||||
context "when the comment body contains a pipeline id" do
|
||||
let(:comment_body) { "/dry-run --pipeline-id 42" }
|
||||
|
||||
it { is_expected.to eq(["pipeline", "--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project", "--pipeline-id", "42"]) }
|
||||
it { is_expected.to eq(["pipeline", ["--azure-devops-organization", "my-organization"], ["--azure-devops-project", "my-project"], ["--pipeline-id", "42"]]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,13 +16,13 @@ RSpec.describe AzureDevops::Migrate do
|
||||
context "when the comment body does not contain a pipeline type" do
|
||||
let(:comment_body) { "/migrate" }
|
||||
|
||||
it { is_expected.to eq(["pipeline", "--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project"]) }
|
||||
it { is_expected.to eq(["pipeline", ["--azure-devops-organization", "my-organization"], ["--azure-devops-project", "my-project"]]) }
|
||||
end
|
||||
|
||||
context "when the comment body contains a pipeline id" do
|
||||
let(:comment_body) { "/migrate --pipeline-id 42 --target-url https://github.com/org/repo" }
|
||||
|
||||
it { is_expected.to eq(["pipeline", "--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project", "--pipeline-id", "42", "--target-url", "https://github.com/org/repo"]) }
|
||||
it { is_expected.to eq(["pipeline", ["--azure-devops-organization", "my-organization"], ["--azure-devops-project", "my-project"], ["--pipeline-id", "42"], ["--target-url", "https://github.com/org/repo"]]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user