diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2026-06-08 17:53:34 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-06-08 09:39:45 +0000 |
| commit | 7ed00ca7a9d3b28330afd4451b8f1613ccd01d83 (patch) | |
| tree | 00e3212c0c1cd8043bd465a87f0819de119b9397 | |
| parent | fadf8f0ea07c94b16d99e369481c3f62614e9ebe (diff) | |
Stamping each solo_gem with its own Time.now.utc lets the two dates
drift apart and matches neither the surrounding before block. Snapshot
the time once so the cooldown window stays stable as thresholds tighten.
https://github.com/ruby/rubygems/commit/69c6d876d4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| -rw-r--r-- | spec/bundler/install/cooldown_spec.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/bundler/install/cooldown_spec.rb b/spec/bundler/install/cooldown_spec.rb index e85267ff41..01e87be663 100644 --- a/spec/bundler/install/cooldown_spec.rb +++ b/spec/bundler/install/cooldown_spec.rb @@ -489,12 +489,13 @@ RSpec.describe "bundle install with the cooldown setting" do end it "keeps a top-level source cooldown through a partial update with multiple sources" do + now = Time.now.utc build_repo4 do build_gem "solo_gem", "1.0.0" do |s| - s.date = Time.now.utc - (30 * 86_400) + s.date = now - (30 * 86_400) end build_gem "solo_gem", "2.0.0" do |s| - s.date = Time.now.utc - (1 * 86_400) + s.date = now - (1 * 86_400) end end @@ -537,12 +538,13 @@ RSpec.describe "bundle install with the cooldown setting" do end it "carries cooldown declared on a gem-block source" do + now = Time.now.utc build_repo4 do build_gem "solo_gem", "1.0.0" do |s| - s.date = Time.now.utc - (30 * 86_400) + s.date = now - (30 * 86_400) end build_gem "solo_gem", "2.0.0" do |s| - s.date = Time.now.utc - (1 * 86_400) + s.date = now - (1 * 86_400) end end |
