Skip to content

Commit f98a85f

Browse files
committed
Update to Ruby 4.0 in tests. Ensure no warning around sync.
1 parent 7f32a08 commit f98a85f

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

Dockerfile

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ RUN apt-get update && apt-get install -y \
3131
&& rm -rf /var/lib/apt/lists/*
3232

3333
# Install ruby-install once (cached layer)
34-
RUN curl -fsSL https://github.com/postmodern/ruby-install/releases/download/v0.9.3/ruby-install-0.9.3.tar.gz | tar -xzf - \
35-
&& cd ruby-install-0.9.3 \
34+
RUN curl -fsSL https://github.com/postmodern/ruby-install/releases/download/v0.10.1/ruby-install-0.10.1.tar.gz | tar -xzf - \
35+
&& cd ruby-install-0.10.1 \
3636
&& make install \
3737
&& cd .. \
38-
&& rm -rf ruby-install-0.9.3
38+
&& rm -rf ruby-install-0.10.1
3939

40-
# Stage for Ruby 3.2.4 compilation
41-
FROM base AS ruby-3-2-4
40+
# Stage for Ruby 4.0.1 compilation
41+
FROM base AS ruby-4-0-1
4242

4343
RUN mkdir -p /opt/rubies && \
4444
MAKE_OPTS="-j$(nproc)" \
4545
ruby-install \
46-
--install-dir /opt/rubies/ruby-3.2.4 \
46+
--install-dir /opt/rubies/ruby-4.0.1 \
4747
--jobs $(nproc) \
4848
--cleanup \
49-
ruby 3.2.4 \
49+
ruby 4.0.1 \
5050
-- --with-jemalloc \
51-
&& /opt/rubies/ruby-3.2.4/bin/gem install bundler --no-document
51+
&& /opt/rubies/ruby-4.0.1/bin/gem install bundler --no-document
5252

5353
# Stage for Ruby 3.4.5 compilation
5454
FROM base AS ruby-3-4-5
@@ -73,7 +73,7 @@ RUN git clone https://github.com/shellspec/shellspec.git /tmp/shellspec \
7373
&& rm -rf /tmp/shellspec
7474

7575
# Copy compiled Ruby installations from parallel stages
76-
COPY --from=ruby-3-2-4 /opt/rubies/ruby-3.2.4 /opt/rubies/ruby-3.2.4
76+
COPY --from=ruby-4-0-1 /opt/rubies/ruby-4.0.1 /opt/rubies/ruby-4.0.1
7777
COPY --from=ruby-3-4-5 /opt/rubies/ruby-3.4.5 /opt/rubies/ruby-3.4.5
7878

7979
# Create test user (non-root for realistic testing)

spec/behaviour/bash_completion_spec.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ Describe "Ruby Butler Bash Completion"
102102
It "provides only version numbers without CRuby prefix"
103103
When run rb __bash_complete "rb -r " 7 --rubies-dir "$RUBIES_DIR"
104104
The status should equal 0
105+
The lines of output should not include "CRuby-4.0.1"
105106
The lines of output should not include "CRuby-3.4.5"
106-
The lines of output should not include "CRuby-3.2.4"
107107
End
108108
End
109109

@@ -136,7 +136,7 @@ Describe "Ruby Butler Bash Completion"
136136
mkdir -p "$PROJECT_DIR"
137137
cat > "$PROJECT_DIR/rbproject.toml" << 'EOF'
138138
[project]
139-
ruby = "3.4.5"
139+
ruby = "4.0.1"
140140
141141
[scripts]
142142
test = "bundle exec rspec"

spec/commands/completion/context_aware_spec.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,11 @@ Describe "Ruby Butler Context-Aware Completion"
156156
Describe "Dockerfile rubies path testing"
157157
Context "non-standard rubies location"
158158
It "completes rubies from /opt/rubies when explicitly specified"
159-
# Test with Docker-style path (Docker has 3.2.4 and 3.4.5)
159+
# Test with Docker-style path (Docker has 3.4.5 and 4.0.1)
160160
When run rb __bash_complete "rb -r " 7 --rubies-dir "/opt/rubies"
161161
The status should equal 0
162+
The output should include "4.0.1"
162163
The output should include "3.4.5"
163-
The output should include "3.2.4"
164164
End
165165
End
166166
End

spec/commands/sync_spec.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ Describe 'rb sync command'
1717
The output should include "Environment Successfully Synchronized"
1818
The output should include "Bundle complete!"
1919
End
20+
21+
It 'does not emit bundler deprecation warnings'
22+
When run rb -R "$RUBIES_DIR" sync
23+
The status should be success
24+
The output should include "Environment Successfully Synchronized"
25+
The stderr should not include "[DEPRECATED]"
26+
End
2027
End
2128

2229
Context 'when running sync in non-bundler project'

spec/support/helpers.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
# ShellSpec helper functions for Ruby Butler
33

44
# Ruby versions available in Docker environment
5-
LATEST_RUBY="3.4.5"
6-
OLDER_RUBY="3.2.4"
5+
LATEST_RUBY="4.0.1"
6+
OLDER_RUBY="3.4.5"
77
RUBIES_DIR="/opt/rubies"
88

99
# Set RB_RUBIES_DIR for all tests so they use Docker Ruby installations
1010
export RB_RUBIES_DIR="$RUBIES_DIR"
1111

12-
# Get Ruby ABI version from full version (e.g., "3.4.5" -> "3.4.0")
12+
# Get Ruby ABI version from full version (e.g., "4.0.1" -> "4.0.0")
1313
get_ruby_abi_version() {
1414
local version="$1"
1515
echo "$version" | sed -E 's/^([0-9]+\.[0-9]+).*/\1.0/'

0 commit comments

Comments
 (0)