File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bats
2
+
3
+ source lib/assert.bash
4
+ source deploy.sh --source-only
5
+
6
+ envfile_backup=.env.bats-bak
7
+
8
+ setup () {
9
+ export GIT_DEPLOY_USERNAME=env-username
10
+ export GIT_DEPLOY_EMAIL=env-email
11
+ export GIT_DEPLOY_DIR=env-dir
12
+ export GIT_DEPLOY_BRANCH=env-branch
13
+ export GIT_DEPLOY_REPO=env-repo
14
+
15
+ if [ -e .env ]; then
16
+ mv .env $envfile_backup
17
+ fi
18
+
19
+ cat << -EOF > .env
20
+ GIT_DEPLOY_USERNAME=dotenv-username
21
+ GIT_DEPLOY_EMAIL=dotenv-email
22
+ GIT_DEPLOY_DIR=dotenv-dir
23
+ GIT_DEPLOY_BRANCH=dotenv-branch
24
+ GIT_DEPLOY_REPO=dotenv-repo
25
+ EOF
26
+ }
27
+
28
+ teardown () {
29
+ rm .env
30
+ if [ -e " $envfile_backup " ]; then
31
+ mv $envfile_backup .env
32
+ fi
33
+ }
34
+
35
+ @test ' dotenv variable: DEFAULT_USERNAME' {
36
+ assert that ` parse_args && echo $default_username ` = " dotenv-username"
37
+ }
38
+ @test ' dotenv variable: DEFAULT_EMAIL' {
39
+ assert that ` parse_args && echo $default_email ` = " dotenv-email"
40
+ }
41
+ @test ' dotenv variable: GIT_DEPLOY_DIR' {
42
+ assert that ` parse_args && echo $deploy_directory ` = " dotenv-dir"
43
+ }
44
+ @test ' dotenv variable: GIT_DEPLOY_BRANCH' {
45
+ assert that ` parse_args && echo $deploy_branch ` = " dotenv-branch"
46
+ }
47
+ @test ' dotenv variable: GIT_DEPLOY_REPO' {
48
+ assert that ` parse_args && echo $repo ` = " dotenv-repo"
49
+ }
50
+
You can’t perform that action at this time.
0 commit comments