Updating distribution

This commit is contained in:
Valet Bot
2022-01-07 19:45:53 +00:00
parent 74be75ac84
commit 51b31a805e
60 changed files with 1895 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
# frozen_string_literal: true
RSpec.describe AzureDevops::Audit do
let(:audit) { described_class.new(issue_content, nil) }
describe "#to_a" do
subject { audit.to_a }
context "when issue_content contains no args" do
let(:issue_content) do
<<~ISSUE
Organization:
Project:
ISSUE
end
it { is_expected.to be_nil }
end
context "when issue_content contains an organization" do
let(:issue_content) do
<<~ISSUE
Organization: my-organization
Project:
ISSUE
end
it { is_expected.to eq(["--azure-devops-organization", "my-organization"]) }
end
context "when issue_content contains a project" do
let(:issue_content) do
<<~ISSUE
Organization: my-organization
Project: my-project
ISSUE
end
it { is_expected.to eq(["--azure-devops-organization", "my-organization", "--azure-devops-project", "my-project"]) }
end
end
end

View File

@@ -0,0 +1,28 @@
# frozen_string_literal: true
RSpec.describe AzureDevops::DryRun do
let(:dry_run) { described_class.new(issue_content, command) }
let(:command) { Command.new(comment_body) }
describe "#to_a" do
subject { dry_run.to_a }
let(:issue_content) do
<<~ISSUE
Organization: my-organization
Project: my-project
ISSUE
end
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"]) }
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"]) }
end
end
end

View File

@@ -0,0 +1,28 @@
# frozen_string_literal: true
RSpec.describe AzureDevops::Migrate do
let(:dry_run) { described_class.new(issue_content, command) }
let(:command) { Command.new(comment_body) }
describe "#to_a" do
subject { dry_run.to_a }
let(:issue_content) do
<<~ISSUE
Organization: my-organization
Project: my-project
ISSUE
end
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"]) }
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"]) }
end
end
end