diff options
author | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 12:36:24 +0530 |
---|---|---|
committer | Sebastian Thiel <sthiel@thoughtworks.com> | 2019-06-01 12:36:24 +0530 |
commit | c1cbcf355755fbd1ca6124cdba3b8e361a7bebf2 (patch) | |
tree | 4f2120ad0e7546423bec08711df84984fc0bfd6c /tests | |
parent | c50332cead2688e40de192e1b47e50a662763a78 (diff) |
Better error reporting
Diffstat (limited to 'tests')
-rw-r--r-- | tests/snapshots/failure-no-arguments-multiple-input-paths-some-not-existing | 6 | ||||
-rw-r--r-- | tests/snapshots/success-no-arguments-multiple-input-paths | 2 | ||||
-rwxr-xr-x | tests/stateless-journey.sh | 7 |
3 files changed, 14 insertions, 1 deletions
diff --git a/tests/snapshots/failure-no-arguments-multiple-input-paths-some-not-existing b/tests/snapshots/failure-no-arguments-multiple-input-paths-some-not-existing new file mode 100644 index 0000000..c685916 --- /dev/null +++ b/tests/snapshots/failure-no-arguments-multiple-input-paths-some-not-existing @@ -0,0 +1,6 @@ +1.26 MB . +1.26 MB . +0.00 B foo <1 IO Error(s)> +0.00 B bar <1 IO Error(s)> +0.00 B baz <1 IO Error(s)> +2.52 MB total <3 IO Error(s)>
\ No newline at end of file diff --git a/tests/snapshots/success-no-arguments-multiple-input-paths b/tests/snapshots/success-no-arguments-multiple-input-paths index 6b8938e..724b074 100644 --- a/tests/snapshots/success-no-arguments-multiple-input-paths +++ b/tests/snapshots/success-no-arguments-multiple-input-paths @@ -3,4 +3,4 @@ 1.26 MB dir 1.26 MB ./dir/ 256.00 KB ./dir/sub -5.29 MB <TOTAL>
\ No newline at end of file +5.29 MB total
\ No newline at end of file diff --git a/tests/stateless-journey.sh b/tests/stateless-journey.sh index a6e0fa5..95886d2 100755 --- a/tests/stateless-journey.sh +++ b/tests/stateless-journey.sh @@ -11,6 +11,7 @@ snapshot="$root/snapshots" fixtures="$root/fixtures" SUCCESSFULLY=0 +WITH_FAILURE=1 (with "a sample directory" (sandbox @@ -36,6 +37,12 @@ SUCCESSFULLY=0 expect_run ${SUCCESSFULLY} "$exe" . . dir ./dir/ ./dir/sub } ) + (when "specifying no subcommand and some of the directories don't exist" + it "produces a human-readable (metric) aggregate of the current directory, with total" && { + WITH_SNAPSHOT="$snapshot/failure-no-arguments-multiple-input-paths-some-not-existing" \ + expect_run ${WITH_FAILURE} "$exe" . . foo bar baz + } + ) ) ) |