Skip to content

Commit 30a0fec

Browse files
tianonjunojense
authored andcommitted
Swap "bundler-audit" for "bundler-compose" in "ruby-binstubs" test (docker-library#20318)
... conditionally (thanks to `jruby:9` being Ruby 3.1) Also, improve the actual test to test the binstubs themselves more explicitly.
1 parent b75e6eb commit 30a0fec

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

test/tests/ruby-binstubs/Gemfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
source 'https://rubygems.org'
2-
gem 'bundler-audit', '0.9.1'
2+
3+
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('3.2')
4+
gem 'bundler-compose', '0.0.2'
5+
else
6+
# TODO when jruby:9 is EOL, we can remove this conditional (and the matching conditional in "container.sh")
7+
# (it's only necessary because jruby:9 is Ruby 3.1 and bundler-compose needs 3.2+)
8+
gem 'bundler-audit', '0.9.1'
9+
end
10+
311
gem 'brakeman', '5.4.1'
Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/bin/sh
2-
set -e
1+
#!/usr/bin/env sh
2+
set -eu
33

44
dir="$(mktemp -d)"
55
trap "rm -rf '$dir'" EXIT
@@ -9,4 +9,13 @@ cp Gemfile "$dir"
99
cd "$dir"
1010

1111
bundle install
12-
bundle audit version
12+
13+
if bundle info bundler-compose; then
14+
bundle compose help > /dev/null
15+
else
16+
bundle info bundler-audit
17+
bundle audit version
18+
fi
19+
20+
bundle info brakeman
21+
brakeman --version

0 commit comments

Comments
 (0)