Skip to content

Latest commit

 

History

History
128 lines (102 loc) · 2.16 KB

suite.clitest.md

File metadata and controls

128 lines (102 loc) · 2.16 KB

add-remote test suite

setup

$ ROOT="$(pwd)"
$ source add-remote.sh
$ source tests/helper.sh
$

add-upstream with ssh

$ cd "$(fakerepo_ssh)"
$ add-upstream another-fake
$ git config --get remote.upstream.url
git@github.com:another-fake/fake.git
$

add-upstream with https

$ cd "$(fakerepo_https)"
$ add-upstream another-fake
$ git config --get remote.upstream.url
https://github.com/another-fake/fake.git
$

add-remote with ssh and 2 args

$ cd "$(fakerepo_ssh)"
$ add-remote fork becker
$ git config --get remote.becker.url
git@github.com:fork/fake.git
$

add-remote with with https and 2 args

$ cd "$(fakerepo_https)"
$ add-remote fork becker
$ git config --get remote.becker.url
https://github.com/fork/fake.git
$

add-remote with ssh and 1 arg

$ cd "$(fakerepo_ssh)"
$ add-remote caarlos0
$ git config --get remote.caarlos0.url
git@github.com:caarlos0/fake.git
$

add-remote with https and 1 arg

$ cd "$(fakerepo_https)"
$ add-remote caarlos0
$ git config --get remote.caarlos0.url
https://github.com/caarlos0/fake.git
$

add-remote when folder is not git repository

$ cd "$(mktempdir)"
$ add-remote whatever
A remote called 'origin' doesn't exist. Aborting.
$

add-upstream when folder is not git repository

$ cd "$(mktempdir)"
$ add-upstream any
A remote called 'origin' doesn't exist. Aborting.
$

add-remote when origin does not exist with ssh

$ cd "$(fakerepo_ssh)"
$ git remote remove origin
$ add-remote ahoy
A remote called 'origin' doesn't exist. Aborting.
$

add-remote when origin does not exist with https

$ cd "$(fakerepo_https)"
$ git remote remove origin
$ add-remote ahoy
A remote called 'origin' doesn't exist. Aborting.
$

add-upstream when origin does not exist with ssh

$ cd "$(fakerepo_ssh)"
$ git remote remove origin
$ add-upstream nope
A remote called 'origin' doesn't exist. Aborting.
$

add-upstream when origin does not exist

$ cd "$(fakerepo_https)"
$ git remote remove origin
$ add-upstream nope
A remote called 'origin' doesn't exist. Aborting.
$