summaryrefslogtreecommitdiffstats
path: root/tests/stateless-journey.sh
diff options
context:
space:
mode:
authorSebastian Thiel <sthiel@thoughtworks.com>2019-05-31 17:50:00 +0530
committerSebastian Thiel <sthiel@thoughtworks.com>2019-05-31 17:50:00 +0530
commit449f964850feb89d8a179bbc8a45cea6580577eb (patch)
tree91ea465288a38f415018cea858012825808fcd76 /tests/stateless-journey.sh
parent247a3b9dc851237288fd243a9029afcec6453e5d (diff)
The first failing test
Diffstat (limited to 'tests/stateless-journey.sh')
-rwxr-xr-xtests/stateless-journey.sh24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/stateless-journey.sh b/tests/stateless-journey.sh
index 13b5753..b170af3 100755
--- a/tests/stateless-journey.sh
+++ b/tests/stateless-journey.sh
@@ -4,22 +4,22 @@ set -eu
exe=${1:?First argument must be the executable to test}
root="$(cd "${0%/*}" && pwd)"
+exe="$root/../$exe"
# shellcheck disable=1090
source "$root/utilities.sh"
snapshot="$root/snapshots"
+fixtures="$root/fixtures"
SUCCESSFULLY=0
-WITH_FAILURE=1
-(with "no input file"
- it "fails with an error message" && {
- WITH_SNAPSHOT="$snapshot/failure-missing-input-file" \
- expect_run ${WITH_FAILURE} "$exe"
- }
-)
-(with "a valid input file"
- it "produces the expected output" && {
- WITH_SNAPSHOT="$snapshot/success-input-file-produces-correct-output" \
- expect_run ${SUCCESSFULLY} "$exe" <(echo this is probably not what you want)
- }
+(with "a sample directory"
+ (sandbox
+ cp -R "$fixtures/sample-01" .
+ (when "running the program without arguments"
+ it "produces a human-readable aggregate of the current directory" && {
+ WITH_SNAPSHOT="$snapshot/success-no-arguments" \
+ expect_run ${SUCCESSFULLY} "$exe"
+ }
+ )
+ )
)