diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-05-31 17:50:00 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-05-31 17:50:00 +0530 |
commit | 449f964850feb89d8a179bbc8a45cea6580577eb (patch) | |
tree | 91ea465288a38f415018cea858012825808fcd76 /tests/stateless-journey.sh | |
parent | 247a3b9dc851237288fd243a9029afcec6453e5d (diff) |
The first failing test
Diffstat (limited to 'tests/stateless-journey.sh')
-rwxr-xr-x | tests/stateless-journey.sh | 24 |
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" + } + ) + ) ) |