Skip to content

Commit

Permalink
fix: running tests from installed bats
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-schulze-vireso committed Sep 13, 2024
1 parent b7ebf13 commit 3887a73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion test/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ setup() {
}

@test "install.sh creates a valid installation, and uninstall.sh undos it" {
run "$PATH_TO_INSTALL_SHELL" "$INSTALL_DIR"
run "$PATH_TO_INSTALL_SHELL" "$INSTALL_DIR" "$BATS_LIBDIR"
[ "$status" -eq 0 ]
[ "$output" == "Installed Bats to $INSTALL_DIR/bin/bats" ]
ls -lr "$INSTALL_DIR"
[ -x "$INSTALL_DIR/bin/bats" ]
[ -x "$INSTALL_DIR/$BATS_LIBDIR/bats-core/formatter.bash" ]
[ -x "$INSTALL_DIR/$BATS_LIBDIR/bats-core/preprocessing.bash" ]
Expand Down
3 changes: 2 additions & 1 deletion test/root.bats
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ setup() {
# give each test their own tmpdir to allow for parallelization without interference
# shellcheck disable=SC2103,SC2164
cd "$BATS_TEST_TMPDIR"
PATH_TO_INSTALL_SHELL="${BATS_TEST_DIRNAME%/*}/install.sh"
mkdir -p {usr/bin,opt/bats-core}
ls -lR .
"$BATS_ROOT/install.sh" "opt/bats-core"
"$PATH_TO_INSTALL_SHELL" "opt/bats-core"

ln -s "usr/bin" "bin"

Expand Down

0 comments on commit 3887a73

Please sign in to comment.