Skip to content

Commit

Permalink
add tests for gitlab: ssh:https://git@host:port origin (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jun 19, 2017
1 parent fbc508a commit 21d3701
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/git-open.bats
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ setup() {
assert_output "https://gitlab.example.com/user/repo/"
}

@test "gitlab: ssh:https:// origin style" {
@test "gitlab: ssh:https://git@ origin" {
# https://github.com/paulirish/git-open/pull/51
git remote set-url origin "ssh:https://[email protected]/user/repo"
git config "gitopen.gitlab.domain" "gitlab.domain.com"
Expand All @@ -186,6 +186,24 @@ setup() {
refute_output --partial "//"
}

@test "gitlab: ssh:https://git@host:port origin" {
# https://github.com/paulirish/git-open/pull/76
# this first set mostly matches the "gitlab: ssh:https://git@ origin" test
git remote set-url origin "ssh:https://[email protected]/XXX/YYY.git"
git config "gitopen.gitlab.domain" "repo.intranet"
run ../git-open
assert_output "https://repo.intranet/XXX/YYY/"
refute_output --partial "ssh:https://"
refute_output --partial "//XXX"

git remote set-url origin "ssh:https://[email protected]:7000/XXX/YYY.git"
git config "gitopen.gitlab.domain" "repo.intranet"
git config "gitopen.gitlab.ssh.port" "7000"
run ../git-open
assert_output "https://repo.intranet/XXX/YYY/"
refute_output --partial "ssh:https://"
refute_output --partial "//XXX"
}

# Tests not yet written:
# * gitopen.gitlab.port
Expand Down

0 comments on commit 21d3701

Please sign in to comment.