Skip to content

Commit cd03b06

Browse files
author
Matt Pearson
committed
Add tests for environment variables.
1 parent 44a35e8 commit cd03b06

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/env-vars.bats

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bats
2+
3+
source lib/assert.bash
4+
source deploy.sh --source-only
5+
6+
setup() {
7+
export GIT_DEPLOY_USERNAME=env-username
8+
export GIT_DEPLOY_EMAIL=env-email
9+
export GIT_DEPLOY_DIR=env-dir
10+
export GIT_DEPLOY_BRANCH=env-branch
11+
export GIT_DEPLOY_REPO=env-repo
12+
export GIT_DEPLOY_APPEN_HASH=false
13+
}
14+
15+
@test 'environment variable: DEFAULT_USERNAME' {
16+
assert that `parse_args && echo $default_username` = "env-username"
17+
}
18+
@test 'environment variable: DEFAULT_EMAIL' {
19+
assert that `parse_args && echo $default_email` = "env-email"
20+
}
21+
@test 'environment variable: GIT_DEPLOY_DIR' {
22+
assert that `parse_args && echo $deploy_directory` = "env-dir"
23+
}
24+
@test 'environment variable: GIT_DEPLOY_BRANCH' {
25+
assert that `parse_args && echo $deploy_branch` = "env-branch"
26+
}
27+
@test 'environment variable: GIT_DEPLOY_REPO' {
28+
assert that `parse_args && echo $repo` = "env-repo"
29+
}
30+
@test 'environment variable: GIT_DEPLOY_APPEND_HASH' {
31+
assert that `parse_args && echo $append_hash` = "false"
32+
}
33+

0 commit comments

Comments
 (0)