forked from X1011/git-directory-deploy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunit-test.bats
More file actions
27 lines (23 loc) · 711 Bytes
/
unit-test.bats
File metadata and controls
27 lines (23 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bats
source lib/assert.bash
source deploy.sh --source-only
repo=https://secret@github.com/user/repo.git
@test 'filter filters repo' {
assert that `echo $repo | filter` = '$repo'
}
@test ' filters repo embedded in string' {
assert that `echo 1${repo}2 | filter` = '1$repo2'
}
@test ' filters repo multiple times' {
assert that `echo 1${repo}2${repo}3 | filter` = '1$repo2$repo3'
}
@test 'sanitize sanitizes stdout' {
assert that `sanitize echo $repo` = '$repo'
}
@test ' sanitizes stderr' {
assert that `sanitize fail $repo 2>&1` = '$repo'
}
@test ' sanitizes xtrace' {
skip
assert that "`(set -o xtrace && sanitize echo $repo)`" = $'+ echo $repo\n $repo'
}