Skip to content

Commit

Permalink
Move loading of helper scripts to central file.
Browse files Browse the repository at this point in the history
  • Loading branch information
kierenevans committed Sep 20, 2017
1 parent cb637fc commit f544aa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ RUN apt-get update -qq \
&& chown -R build:build /usr/local/share/bats/

COPY ./tests/plan.sh /usr/local/share/container/plan.sh
COPY ./tests/bats/helper.bash /usr/local/share/bats/
COPY . /app
WORKDIR /app

Expand Down
4 changes: 4 additions & 0 deletions tests/bats/helper.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
load /usr/local/share/bats/bats-support/load.bash
load /usr/local/share/bats/bats-assert/load.bash
load /usr/local/share/bats/bats-mock/stub.bash
6 changes: 2 additions & 4 deletions ubuntu/16.04/tests/common_functions.bats
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bats

load /usr/local/share/bats/helper.bash

# shellcheck source=../usr/local/share/bootstrap/common_functions.sh
source "$BATS_TEST_DIRNAME/../usr/local/share/bootstrap/common_functions.sh"

Expand All @@ -9,10 +11,6 @@ function setup() {
}
}

load /usr/local/share/bats/bats-support/load.bash
load /usr/local/share/bats/bats-assert/load.bash
load /usr/local/share/bats/bats-mock/stub.bash

@test "escape_shell_args escapes spaces" {
run escape_shell_args 'test test2'
assert_success
Expand Down

0 comments on commit f544aa3

Please sign in to comment.