From 70f2d399a459f0562a23f2e77b7b68219b5f4c7b Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Sat, 14 Jan 2017 18:43:49 -0500 Subject: [PATCH 1/3] lib/format: Fix incorrect @go.array_printf comment Meant to say ASCII Unit Separator in #107, not Record Separator. --- lib/format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/format b/lib/format index 059b749..6c5dd97 100644 --- a/lib/format +++ b/lib/format @@ -23,7 +23,7 @@ # provides a portable means of printing to an array variable while avoiding the # use of `eval`. # -# NOTE: By default, this function relies on the ASCII Record Separator character +# NOTE: By default, this function relies on the ASCII Unit Separator character # ($'\x1f') to delimit generated strings before splitting them into the result # array. If you have strings containing this character, you can set a new # delimiter via `_GO_ARRAY_PRINTF_DELIMITER`. From 4b58fbc20279b20c44158b9d44addb9a876e1f94 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 12 Jan 2017 23:08:42 -0500 Subject: [PATCH 2/3] core: Add _@go.set_scripts_dir missing dir test Been meaning to add this forever. Took all of thirty seconds. --- tests/core/set-scripts-dir.bats | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/core/set-scripts-dir.bats b/tests/core/set-scripts-dir.bats index 132f223..64e9986 100644 --- a/tests/core/set-scripts-dir.bats +++ b/tests/core/set-scripts-dir.bats @@ -35,6 +35,13 @@ teardown() { assert_failure "$expected" } +@test "$SUITE: produce an error if the script dir isn't a directory" { + rm -rf "$TEST_GO_SCRIPTS_DIR" + printf '' >"$TEST_GO_SCRIPTS_DIR" + run "$TEST_GO_SCRIPT" + assert_failure "ERROR: $TEST_GO_SCRIPTS_DIR is not a directory" +} + @test "$SUITE: produce an error if the script dir can't be read or accessed" { skip_if_cannot_trigger_file_permission_failure From 674636dba5aa2f3a3ec598df37ac53d605e8ab93 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 12 Jan 2017 23:05:30 -0500 Subject: [PATCH 3/3] lib/testing: Add new create_core_module_stub test --- tests/testing/stubbing.bats | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/testing/stubbing.bats b/tests/testing/stubbing.bats index 888db36..980c847 100644 --- a/tests/testing/stubbing.bats +++ b/tests/testing/stubbing.bats @@ -26,3 +26,10 @@ teardown() { [ -e "$_GO_CORE_DIR/lib/log" ] assert_success 'Hello, World!' } + + +@test "$SUITE: create_core_module_stub aborts if module unknown" { + [ ! -e "$_GO_CORE_DIR/lib/foobar" ] + run create_core_module_stub 'foobar' 'echo Hello, World!' + assert_failure "No such core module: $_GO_CORE_DIR/lib/foobar" +}