Skip to content

Commit

Permalink
feat: add tests
Browse files Browse the repository at this point in the history
Inspired by gliderlabs/docker-alpine
  • Loading branch information
virtualroot committed Jul 27, 2023
1 parent 82b2c53 commit 0d5c9e7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/alpine.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
setup() {
docker history alpine >/dev/null 2>&1
}

@test "whoami" {
run docker run alpine whoami
[ $status -eq 0 ]
[ "${lines[0]}" = "app" ]
}

@test "workdir" {
run docker run alpine pwd
[ $status -eq 0 ]
[ "${lines[0]}" = "/app" ]
}
16 changes: 16 additions & 0 deletions test/debian.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
setup() {
docker history debian >/dev/null 2>&1
}

@test "whoami app" {
run docker run debian whoami
[ $status -eq 0 ]
[ "${lines[0]}" = "app" ]
}

@test "workdir" {
run docker run debian pwd
[ $status -eq 0 ]
[ "${lines[0]}" = "/app" ]
}

16 changes: 16 additions & 0 deletions test/ubuntu.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
setup() {
docker history ubuntu >/dev/null 2>&1
}

@test "whoami app" {
run docker run ubuntu whoami
[ $status -eq 0 ]
[ "${lines[0]}" = "app" ]
}

@test "workdir" {
run docker run ubuntu pwd
[ $status -eq 0 ]
[ "${lines[0]}" = "/app" ]
}

0 comments on commit 0d5c9e7

Please sign in to comment.