Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-brew-formulae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: INSTALL local formula
run: brew install --build-from-source --verbose $PACKAGE
- name: AUDIT
run: brew audit --new-formula --formula Formula/$PACKAGE.rb
run: brew audit --new-formula $PACKAGE
- name: INSTALL
run: brew install --build-from-source --verbose $PACKAGE
- name: TEST
Expand Down
11 changes: 7 additions & 4 deletions Formula/bats-assert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ def install
def caveats
<<~EOS
To load the bats-assert lib in your bats test:
load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-assert/load.bash'
#Set the bats_lib_path
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-support
bats_load_library bats-assert
EOS
end

test do
(testpath/"test.bats").write <<~EOS
setup() {
load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-assert/load.bash'
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-support
bats_load_library bats-assert
}

@test "assert true" {
Expand Down
9 changes: 5 additions & 4 deletions Formula/bats-detik.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ def caveats
<<~EOS
To load the bats-detik lib in your bats test:

load '#{HOMEBREW_PREFIX}/lib/bats-detik/utils.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-detik/detik.bash'
#Set the bats_lib_path
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-detik/detik.bash

DETIK_CLIENT_NAME="kubectl"
EOS
Expand All @@ -31,8 +32,8 @@ def caveats
test do
(testpath/"test.bats").write <<~EOS
setup() {
load '#{HOMEBREW_PREFIX}/lib/bats-detik/utils.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-detik/detik.bash'
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-detik/detik.bash
}

DETIK_CLIENT_NAME="mytest"
Expand Down
11 changes: 7 additions & 4 deletions Formula/bats-file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ def caveats

To load the bats-file lib in your bats test:

load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-file/load.bash'
#Set the bats_lib_path
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-support
bats_load_library bats-file
EOS
end

test do
(testpath/"test.bats").write <<~EOS
setup() {
load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
load '#{HOMEBREW_PREFIX}/lib/bats-file/load.bash'
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-support
bats_load_library bats-file
}

@test 'assert_file_exist() <file>: returns 0 if <file> exists' {
Expand Down
4 changes: 3 additions & 1 deletion Formula/bats-support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ def caveats

To load the bats-support lib in your bats test:

load '#{HOMEBREW_PREFIX}/lib/bats-support/load.bash'
#Set the bats_lib_path
export BATS_LIB_PATH="${BATS_LIB_PATH}:${HOMEBREW_PREFIX}/lib"
bats_load_library bats-support
EOS
end

Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ Repository for managing bats-core and its dependencies on homebrew

OS X users can use Homebrew to install libraries system-wide

```
```bash
$ brew install bats-core
```

Then install the desired libraries.
```

```bash
$ brew tap bats-core/bats-core
$ brew install bats-support
$ brew install bats-assert
Expand All @@ -22,8 +24,9 @@ For brew installations, load the libraries from $(brew --prefix)/lib/ (the brew

```bash
TEST_BREW_PREFIX="$(brew --prefix)"
load "${TEST_BREW_PREFIX}/lib/bats-support/load.bash"
load "${TEST_BREW_PREFIX}/lib/bats-assert/load.bash"
load "${TEST_BREW_PREFIX}/lib/bats-file/load.bash"
load "${TEST_BREW_PREFIX}/lib/bats-detik/load.bash"
export BATS_LIB_PATH="${BATS_LIB_PATH}:${TEST_BREW_PREFIX}/lib"
bats_load_library bats-support
bats_load_library bats-assert
bats_load_library bats-file
bats_load_library bats-detik/detik.bash
```