Skip to content

Commit b449cd0

Browse files
authored
Add BB sourceview tests from PR #26 (#81)
1 parent 42a4a0e commit b449cd0

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
sandboxrepo

test/git-open.bats

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,28 @@ setup() {
112112
assert_output --partial "//?at=master"
113113
}
114114

115-
@test "bitbucket: branch" {
116-
git remote set-url origin "https://[email protected]/malb/lwe-estimator.git"
117-
git checkout -B "new-bkw"
115+
@test "bitbucket: open source view" {
116+
# https://github.com/paulirish/git-open/pull/26
117+
git remote set-url origin "https://bitbucket.org/kisom/consbri.git"
118+
git checkout -B "devel"
118119
run ../git-open
119-
assert_output --partial "https://bitbucket.org/malb/lwe-estimator/src/"
120-
assert_output --partial "?at=new-bkw"
120+
assert_output --partial "https://bitbucket.org/kisom/consbri/src/"
121+
assert_output --partial "?at=devel"
122+
123+
# FIXME: deal with the double slash in the URL
124+
skip # FWIW, above assertions are still tested ;)
125+
refute_output --partial "//"
126+
}
127+
128+
@test "bitbucket: open source view with a slash/branch" {
129+
# https://github.com/paulirish/git-open/pull/26
130+
# see https://github.com/paulirish/git-open/issues/80 for feat/branchname issues
131+
git remote set-url origin "https://bitbucket.org/guyzmo/git-repo.git"
132+
git checkout -B "bugfix/conftest_fix"
133+
run ../git-open
134+
assert_output --partial "https://bitbucket.org/guyzmo/git-repo/src/"
135+
# BB appears to be fine with both literal or URL-encoded forward slash
136+
assert_output --partial "?at=bugfix/conftest_fix"
121137
}
122138

123139
@test "bitbucket: ssh:// clone urls" {
@@ -164,7 +180,10 @@ setup() {
164180
run ../git-open
165181
assert_output --partial "https://gitlab.domain.com/"
166182
assert_output --partial "/user/repo/"
167-
# assert_output "https://gitlab.domain.com//user/repo/" # TODO fix double slash
183+
184+
# FIXME: deal with the double slash in the URL
185+
skip
186+
refute_output --partial "//"
168187
}
169188

170189

0 commit comments

Comments
 (0)