Skip to content

Commit 91b35b0

Browse files
princejosephclaude
andcommitted
Fix CI failures: chromedriver path and Timecop Ruby 3.x private method
- Remove manual driver_path in github driver; Selenium Manager (selenium-webdriver >= 4.11) finds chromedriver automatically - Drop setup-chrome from workflow; Chrome is pre-installed on ubuntu-latest - Remove `private` from Timecop monkey patch in time_cop.rb — the patch accidentally made travel/unmock! private, causing NoMethodError on Ruby 3.x where explicit-receiver calls to private methods are forbidden Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d63cd8e commit 91b35b0

3 files changed

Lines changed: 1 addition & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,8 @@ jobs:
3434
working-directory: ruby/${{ matrix.gem }}
3535
bundler-cache: true
3636

37-
- name: Set up Chrome
38-
uses: browser-actions/setup-chrome@v1
39-
id: setup-chrome
40-
4137
- name: Run specs
4238
run: bundle exec rake spec
4339
env:
4440
DRIVER: github
45-
CHROMEWEBDRIVER: ${{ steps.setup-chrome.outputs.chromedriver-path }}
4641
RAILS_ENV: test

ruby/hyper-spec/lib/hyper-spec.rb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,13 @@ def self.on_server?
245245
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
246246
end
247247

248-
# GitHub Actions: setup-chrome sets CHROMEWEBDRIVER to the chromedriver directory
248+
# GitHub Actions: Selenium Manager (selenium-webdriver >= 4.11) finds chromedriver automatically
249249
Capybara.register_driver :chrome_headless_github_actions do |app|
250250
options = ::Selenium::WebDriver::Chrome::Options.new
251251
options.add_argument('--headless')
252252
options.add_argument('--no-sandbox')
253253
options.add_argument('--disable-dev-shm-usage')
254254
options.add_argument('--disable-gpu')
255-
if (dir = ENV['CHROMEWEBDRIVER'])
256-
Selenium::WebDriver::Chrome::Service.driver_path = File.join(dir, 'chromedriver')
257-
end
258255
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
259256
end
260257

ruby/hyper-spec/lib/hyper-spec/internal/time_cop.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,6 @@ def run_pending_evaluations
164164

165165
# Monkey patches to call our Lolex interface
166166
class Timecop
167-
private
168-
169167
def travel(mock_type, *args, &block)
170168
raise SafeModeException if Timecop.safe_mode? && !block_given?
171169

0 commit comments

Comments
 (0)