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 +}