From a4c16fecefabac9d1ff1defcfdc6a88840e71cbe Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 28 Dec 2011 21:41:23 -0600 Subject: [PATCH] Test `load` --- test/bats.bats | 5 +++++ test/fixtures/load.bats | 5 +++++ test/fixtures/test_helper.bash | 3 +++ 3 files changed, 13 insertions(+) create mode 100644 test/fixtures/load.bats create mode 100644 test/fixtures/test_helper.bash diff --git a/test/bats.bats b/test/bats.bats index 99888ad..74a3f73 100755 --- a/test/bats.bats +++ b/test/bats.bats @@ -67,3 +67,8 @@ teardown() { run cat "$TMP/teardown.log" [ ${#lines[@]} -eq 3 ] } + +@test "load sources scripts relative to the current test file" { + run bats "$FIXTURE_ROOT/load.bats" + [ $status -eq 0 ] +} diff --git a/test/fixtures/load.bats b/test/fixtures/load.bats new file mode 100644 index 0000000..4d677a5 --- /dev/null +++ b/test/fixtures/load.bats @@ -0,0 +1,5 @@ +load test_helper + +@test "calling a loaded helper" { + help_me +} diff --git a/test/fixtures/test_helper.bash b/test/fixtures/test_helper.bash new file mode 100644 index 0000000..c68e50e --- /dev/null +++ b/test/fixtures/test_helper.bash @@ -0,0 +1,3 @@ +help_me() { + true +}