Skip to content

Commit 3df6b30

Browse files
hsbtclaude
andcommitted
Cover cooldown outdated annotation and update error path
Adds three E2E checks against the v2 cooldown artifice: the negative CLI value is rejected at parse time, `bundle outdated --cooldown` tags the latest-but-cooled version in both table and parseable output, and `bundle update --cooldown 99999` surfaces the cooldown hint when every candidate is filtered. These were the remaining coverage gaps called out in the adversarial review. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 45e54d5 commit 3df6b30

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

spec/install/cooldown_spec.rb

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444

4545
expect(the_bundle).to include_gems("myrack 1.0.0")
4646
end
47+
48+
it "rejects a negative --cooldown value" do
49+
bundle "install --cooldown=-7", artifice: "compact_index", raise_on_error: false
50+
51+
expect(err).to match(/non-negative integer/)
52+
end
4753
end
4854

4955
context "configuration" do
@@ -154,5 +160,87 @@
154160

155161
expect(the_bundle).to include_gems("ripe_gem 2.0.0")
156162
end
163+
164+
it "annotates in-cooldown versions in bundle outdated table output" do
165+
gemfile <<-G
166+
source "https://gem.repo3"
167+
gem "ripe_gem", "1.0.0"
168+
G
169+
170+
lockfile <<-L
171+
GEM
172+
remote: https://gem.repo3/
173+
specs:
174+
ripe_gem (1.0.0)
175+
176+
PLATFORMS
177+
#{lockfile_platforms}
178+
179+
DEPENDENCIES
180+
ripe_gem (= 1.0.0)
181+
182+
BUNDLED WITH
183+
#{Bundler::VERSION}
184+
L
185+
186+
bundle "outdated --cooldown 7", artifice: "compact_index_cooldown", raise_on_error: false
187+
188+
expect(out).to match(/ripe_gem.*\(cooldown \d+d\)/)
189+
end
190+
191+
it "annotates in-cooldown versions in bundle outdated --parseable output" do
192+
gemfile <<-G
193+
source "https://gem.repo3"
194+
gem "ripe_gem", "1.0.0"
195+
G
196+
197+
lockfile <<-L
198+
GEM
199+
remote: https://gem.repo3/
200+
specs:
201+
ripe_gem (1.0.0)
202+
203+
PLATFORMS
204+
#{lockfile_platforms}
205+
206+
DEPENDENCIES
207+
ripe_gem (= 1.0.0)
208+
209+
BUNDLED WITH
210+
#{Bundler::VERSION}
211+
L
212+
213+
bundle "outdated --cooldown 7 --parseable", artifice: "compact_index_cooldown", raise_on_error: false
214+
215+
expect(out).to match(/ripe_gem.*in cooldown for \d+ more day/)
216+
end
217+
218+
it "surfaces a cooldown hint when bundle update filters every candidate" do
219+
gemfile <<-G
220+
source "https://gem.repo3"
221+
gem "ripe_gem"
222+
G
223+
224+
lockfile <<-L
225+
GEM
226+
remote: https://gem.repo3/
227+
specs:
228+
ripe_gem (1.0.0)
229+
230+
PLATFORMS
231+
#{lockfile_platforms}
232+
233+
DEPENDENCIES
234+
ripe_gem
235+
236+
BUNDLED WITH
237+
#{Bundler::VERSION}
238+
L
239+
240+
bundle "update ripe_gem --cooldown 99999", artifice: "compact_index_cooldown", raise_on_error: false
241+
242+
expect(err).to match(/excluded by the cooldown setting/)
243+
expect(err).to match(/--cooldown 0/)
244+
end
157245
end
158246
end

0 commit comments

Comments
 (0)