From da012f5a9cce3c43c41827bcf5f746473a8a2414 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 27 Aug 2023 10:52:01 +0200 Subject: [PATCH 1/8] update file to 0.4.0 and refresh load instruction --- Formula/bats-file.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Formula/bats-file.rb b/Formula/bats-file.rb index 8788d03..d32073a 100644 --- a/Formula/bats-file.rb +++ b/Formula/bats-file.rb @@ -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() : returns 0 if exists' { From 97bc1c4d74264a5846295c6ba5e730bee54147a1 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 27 Aug 2023 11:04:49 +0200 Subject: [PATCH 2/8] fix new audit syntax --- .github/workflows/test-brew-formulae.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-brew-formulae.yaml b/.github/workflows/test-brew-formulae.yaml index 40d2d30..0cab0c5 100644 --- a/.github/workflows/test-brew-formulae.yaml +++ b/.github/workflows/test-brew-formulae.yaml @@ -1,4 +1,4 @@ -name: CI +name: test-bats-libs-formulae on: push: @@ -8,18 +8,15 @@ on: jobs: test-packages: - name: test-formulae strategy: fail-fast: false matrix: package: [bats-support, bats-assert, bats-detik, bats-file] - os: [macos-14, macos-15, macos-latest] - runs-on: ${{ matrix.os }} + runs-on: macos-latest env: PACKAGE: ${{ matrix.package }} - TERM: xterm steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 + - uses: actions/checkout@v2 - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@master - name: Brew version output @@ -34,8 +31,8 @@ jobs: - name: INSTALL local formula run: brew install --build-from-source --verbose $PACKAGE - name: AUDIT - run: brew audit --new $PACKAGE + run: brew audit --new-formula $PACKAGE.rb - name: INSTALL run: brew install --build-from-source --verbose $PACKAGE - name: TEST - run: brew test $PACKAGE + run: brew test Formula/$PACKAGE.rb From 8aa1ee8d4681cb6e92a1b2505526004b1ca6cf93 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 27 Aug 2023 11:06:53 +0200 Subject: [PATCH 3/8] fixup! --- .github/workflows/test-brew-formulae.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-brew-formulae.yaml b/.github/workflows/test-brew-formulae.yaml index 0cab0c5..76180d2 100644 --- a/.github/workflows/test-brew-formulae.yaml +++ b/.github/workflows/test-brew-formulae.yaml @@ -31,7 +31,7 @@ jobs: - name: INSTALL local formula run: brew install --build-from-source --verbose $PACKAGE - name: AUDIT - run: brew audit --new-formula $PACKAGE.rb + run: brew audit --new-formula $PACKAGE - name: INSTALL run: brew install --build-from-source --verbose $PACKAGE - name: TEST From 4514466536d65f7f7d5b21790901c725a5b0bc21 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Mon, 28 Aug 2023 00:19:18 +0200 Subject: [PATCH 4/8] update instruction in assert, support, detik --- Formula/bats-assert.rb | 11 +++++++---- Formula/bats-detik.rb | 9 +++++---- Formula/bats-support.rb | 4 +++- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Formula/bats-assert.rb b/Formula/bats-assert.rb index 4e4c1da..83e36bc 100644 --- a/Formula/bats-assert.rb +++ b/Formula/bats-assert.rb @@ -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" { diff --git a/Formula/bats-detik.rb b/Formula/bats-detik.rb index ac6f261..5c083df 100644 --- a/Formula/bats-detik.rb +++ b/Formula/bats-detik.rb @@ -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 @@ -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" diff --git a/Formula/bats-support.rb b/Formula/bats-support.rb index 5d8c56b..3022bb0 100644 --- a/Formula/bats-support.rb +++ b/Formula/bats-support.rb @@ -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 From 1eeebed439a7c8268fee003a828d74258ba0b553 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Mon, 28 Aug 2023 00:24:07 +0200 Subject: [PATCH 5/8] update README as well --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 392cdeb..5dee22a 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` From 29f080d8f417fdd3d045a8fb2e2278798724660c Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 5 Nov 2023 00:32:39 +0100 Subject: [PATCH 6/8] remove file-update from this branch --- Formula/bats-file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/bats-file.rb b/Formula/bats-file.rb index d32073a..92ff59f 100644 --- a/Formula/bats-file.rb +++ b/Formula/bats-file.rb @@ -1,8 +1,8 @@ class BatsFile < Formula desc "Common filesystem assertions for Bats" homepage "https://github.com/bats-core/bats-file" - url "https://github.com/bats-core/bats-file/archive/refs/tags/v0.4.0.tar.gz" - sha256 "9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a" + url "https://github.com/bats-core/bats-file/archive/refs/tags/v0.3.0.tar.gz" + sha256 "54d1c8b1908608aef8e46ac17d4001a75119e279662aeac4e5859ce780515362" license "MIT" head "https://github.com/bats-core/bats-file.git", branch: "master" From c4ac380909e3ca8574faf44d0d2eb233d3758cfd Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 15 Mar 2026 15:53:30 +0100 Subject: [PATCH 7/8] merge --- .github/workflows/test-brew-formulae.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-brew-formulae.yaml b/.github/workflows/test-brew-formulae.yaml index 76180d2..40d2d30 100644 --- a/.github/workflows/test-brew-formulae.yaml +++ b/.github/workflows/test-brew-formulae.yaml @@ -1,4 +1,4 @@ -name: test-bats-libs-formulae +name: CI on: push: @@ -8,15 +8,18 @@ on: jobs: test-packages: + name: test-formulae strategy: fail-fast: false matrix: package: [bats-support, bats-assert, bats-detik, bats-file] - runs-on: macos-latest + os: [macos-14, macos-15, macos-latest] + runs-on: ${{ matrix.os }} env: PACKAGE: ${{ matrix.package }} + TERM: xterm steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4 - name: Set up Homebrew uses: Homebrew/actions/setup-homebrew@master - name: Brew version output @@ -31,8 +34,8 @@ jobs: - name: INSTALL local formula run: brew install --build-from-source --verbose $PACKAGE - name: AUDIT - run: brew audit --new-formula $PACKAGE + run: brew audit --new $PACKAGE - name: INSTALL run: brew install --build-from-source --verbose $PACKAGE - name: TEST - run: brew test Formula/$PACKAGE.rb + run: brew test $PACKAGE From a7a1ba18d1600200fd1d23327c18cbb3b3958d5b Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 15 Mar 2026 15:55:54 +0100 Subject: [PATCH 8/8] fix bats-file version to 0.4.0 --- Formula/bats-file.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Formula/bats-file.rb b/Formula/bats-file.rb index 92ff59f..d32073a 100644 --- a/Formula/bats-file.rb +++ b/Formula/bats-file.rb @@ -1,8 +1,8 @@ class BatsFile < Formula desc "Common filesystem assertions for Bats" homepage "https://github.com/bats-core/bats-file" - url "https://github.com/bats-core/bats-file/archive/refs/tags/v0.3.0.tar.gz" - sha256 "54d1c8b1908608aef8e46ac17d4001a75119e279662aeac4e5859ce780515362" + url "https://github.com/bats-core/bats-file/archive/refs/tags/v0.4.0.tar.gz" + sha256 "9b69043241f3af1c2d251f89b4fcafa5df3f05e97b89db18d7c9bdf5731bb27a" license "MIT" head "https://github.com/bats-core/bats-file.git", branch: "master"