Add Bitbucket support

This commit is contained in:
chaseshak
2023-09-13 13:12:05 -05:00
parent 65b029a677
commit d9b386d83b
10 changed files with 160 additions and 2 deletions
+29
View File
@@ -0,0 +1,29 @@
# frozen_string_literal: true
RSpec.describe Bitbucket::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
Workspace:
ISSUE
end
it { is_expected.to be_nil }
end
context "when issue_content contains a organization" do
let(:issue_content) do
<<~ISSUE
Workspace: testing
ISSUE
end
it { is_expected.to eq([["--workspace", "testing"]]) }
end
end
end
+21
View File
@@ -0,0 +1,21 @@
# frozen_string_literal: true
RSpec.describe Bitbucket::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
Workspace: testing
ISSUE
end
context "when the comment body contains a repository" do
let(:comment_body) { "/dry-run --repository repo" }
it { is_expected.to eq([["--workspace", "testing"], ["--repository", "repo"]]) }
end
end
end
+21
View File
@@ -0,0 +1,21 @@
# frozen_string_literal: true
RSpec.describe Bitbucket::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
Workspace: testing
ISSUE
end
context "when the comment body contains a repository" do
let(:comment_body) { "/migrate --repository repo --target-url https://github.com/org/repo" }
it { is_expected.to eq([["--workspace", "testing"], ["--repository", "repo"], ["--target-url", "https://github.com/org/repo"]]) }
end
end
end