Updating distribution
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe GitlabCI::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
|
||||
Namespace:
|
||||
ISSUE
|
||||
end
|
||||
|
||||
it { is_expected.to be_nil }
|
||||
end
|
||||
|
||||
context "when issue_content contains a namespace" do
|
||||
let(:issue_content) do
|
||||
<<~ISSUE
|
||||
Namespace: testing
|
||||
ISSUE
|
||||
end
|
||||
|
||||
it { is_expected.to eq(["--namespace", "testing"]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe GitlabCI::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
|
||||
Namespace: testing
|
||||
ISSUE
|
||||
end
|
||||
|
||||
context "when the comment body contains a pipeline id" do
|
||||
let(:comment_body) { "/dry-run --project project" }
|
||||
|
||||
it { is_expected.to eq(["--namespace", "testing", "--project", "project"]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe GitlabCI::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
|
||||
Namespace: testing
|
||||
ISSUE
|
||||
end
|
||||
|
||||
context "when the comment body contains a pipeline id" do
|
||||
let(:comment_body) { "/migrate --project project --target-url https://github.com/org/repo" }
|
||||
|
||||
it { is_expected.to eq(["--namespace", "testing", "--project", "project", "--target-url", "https://github.com/org/repo"]) }
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user