From b449cd0cbcee6a745b637c3aa457b5b75051ba6b Mon Sep 17 00:00:00 2001 From: Paul Irish Date: Sun, 18 Jun 2017 13:38:43 -0700 Subject: [PATCH] Add BB sourceview tests from PR #26 (#81) --- .gitignore | 1 + test/git-open.bats | 31 +++++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c2658d7..ef5e558 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ node_modules/ +sandboxrepo diff --git a/test/git-open.bats b/test/git-open.bats index 1a6aa11..0b9b68c 100644 --- a/test/git-open.bats +++ b/test/git-open.bats @@ -112,12 +112,28 @@ setup() { assert_output --partial "//?at=master" } -@test "bitbucket: branch" { - git remote set-url origin "https://paulirish@bitbucket.org/malb/lwe-estimator.git" - git checkout -B "new-bkw" +@test "bitbucket: open source view" { + # https://github.com/paulirish/git-open/pull/26 + git remote set-url origin "https://bitbucket.org/kisom/consbri.git" + git checkout -B "devel" run ../git-open - assert_output --partial "https://bitbucket.org/malb/lwe-estimator/src/" - assert_output --partial "?at=new-bkw" + assert_output --partial "https://bitbucket.org/kisom/consbri/src/" + assert_output --partial "?at=devel" + + # FIXME: deal with the double slash in the URL + skip # FWIW, above assertions are still tested ;) + refute_output --partial "//" +} + +@test "bitbucket: open source view with a slash/branch" { + # https://github.com/paulirish/git-open/pull/26 + # see https://github.com/paulirish/git-open/issues/80 for feat/branchname issues + git remote set-url origin "https://bitbucket.org/guyzmo/git-repo.git" + git checkout -B "bugfix/conftest_fix" + run ../git-open + assert_output --partial "https://bitbucket.org/guyzmo/git-repo/src/" + # BB appears to be fine with both literal or URL-encoded forward slash + assert_output --partial "?at=bugfix/conftest_fix" } @test "bitbucket: ssh:// clone urls" { @@ -164,7 +180,10 @@ setup() { run ../git-open assert_output --partial "https://gitlab.domain.com/" assert_output --partial "/user/repo/" - # assert_output "https://gitlab.domain.com//user/repo/" # TODO fix double slash + + # FIXME: deal with the double slash in the URL + skip + refute_output --partial "//" }