From 79f442e45605322fdc293522a12718a9d5221499 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sun, 24 Dec 2017 19:08:05 -0800 Subject: [PATCH] Start testing environment --- docker-compose.yml | 18 ++++++++++++++++++ test/bats.sh | 11 +++++++++++ 2 files changed, 29 insertions(+) create mode 100644 docker-compose.yml create mode 100644 test/bats.sh diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..69bc65b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +version: '2' + +services: + development: + build: + context: . + volumes: + - .:/opt/src/getssld + - /tmp/testing:/ssl + entrypoint: /bin/ash + + bats: + build: + context: ../../bats-core/ + image: bats:latest + volumes: + - .:/code + command: /code/test/bats.sh diff --git a/test/bats.sh b/test/bats.sh new file mode 100644 index 0000000..5683371 --- /dev/null +++ b/test/bats.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bats + +@test "addition using bc" { + result="$(echo 2+2 | bc)" + [ "$result" -eq 4 ] +} + +@test "addition using dc" { + result="$(echo 2 2+p | dc)" + [ "$result" -eq 4 ] +}