-
Notifications
You must be signed in to change notification settings - Fork 930
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Strict type
Dependabot::PullRequestCreator::Bitbucket
- Loading branch information
1 parent
71580c0
commit b04766e
Showing
3 changed files
with
123 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
common/spec/dependabot/pull_request_creator/bitbucket_test.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# typed: strict | ||
# frozen_string_literal: true | ||
|
||
require "minitest/autorun" | ||
|
||
require "dependabot/pull_request_creator/bitbucket" | ||
|
||
class TestBitbucket < Minitest::Test | ||
def setup | ||
@source = Dependabot::Source.new(provider: "bitbucket", repo: "org/gocardless/_git/bump") | ||
@branch_name = "dependabot/bundler/business-1.5.0" | ||
@base_commit = "basecommitsha" | ||
@credentials = [ | ||
Dependabot::Credential.new({ | ||
"type" => "git_source", | ||
"host" => "bitbucket.org", | ||
"username" => "x-access-token", | ||
"password" => "token" | ||
}) | ||
] | ||
@commit_message = "Commit msg" | ||
@pr_description = "PR msg" | ||
@pr_name = "PR name" | ||
@author_details = nil | ||
@labeler = nil | ||
@work_item = nil | ||
|
||
@creator = Dependabot::PullRequestCreator::Bitbucket.new( | ||
source: @source, | ||
branch_name: @branch_name, | ||
base_commit: @base_commit, | ||
credentials: @credentials, | ||
files: [], | ||
commit_message: @commit_message, | ||
pr_description: @pr_description, | ||
pr_name: @pr_name, | ||
author_details: @author_details, | ||
labeler: @labeler, | ||
work_item: @work_item | ||
) | ||
end | ||
|
||
def test_source | ||
assert_equal @source, @creator.source | ||
end | ||
end |