mirror of
https://github.com/paulirish/git-open.git
synced 2026-09-10 07:26:15 -04:00
add git-open.bats for general tests.
For blaming: 7449bfa7e1/test/git-open.bats
This commit is contained in:
parent
ee213388d2
commit
d3f5a70172
42
test/git-open.bats
Executable file
42
test/git-open.bats
Executable file
|
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env bats
|
||||
|
||||
load "test_helper/index"
|
||||
|
||||
##
|
||||
## Test environment
|
||||
##
|
||||
@test "test environment" {
|
||||
assert_equal "$BROWSER" "echo"
|
||||
cd ..
|
||||
assert [ -e "$foldername" ]
|
||||
assert [ -e "$foldername/.git" ]
|
||||
}
|
||||
|
||||
##
|
||||
## Help
|
||||
##
|
||||
|
||||
@test "help text" {
|
||||
run ../git-open -h
|
||||
assert_output --partial "usage: git open"
|
||||
}
|
||||
|
||||
@test "invalid option" {
|
||||
run ../git-open --invalid-option
|
||||
assert_output --partial "error: unknown option \`invalid-option'"
|
||||
assert_output --partial "usage: git open"
|
||||
}
|
||||
|
||||
##
|
||||
## url handling
|
||||
##
|
||||
|
||||
@test "url: insteadOf handling" {
|
||||
git config --global url.http://example.com/.insteadOf ex:
|
||||
git remote set-url origin ex:example.git
|
||||
git checkout -B master
|
||||
run ../git-open
|
||||
assert_output "http://example.com/example"
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in a new issue