Skip to content

Commit

Permalink
Merge pull request #74 from wolkenwerk/capybara-3.37
Browse files Browse the repository at this point in the history
Fix incompatibilities with Capybara 3.37.0 and 3.38.0
  • Loading branch information
phillbaker authored Mar 15, 2023
2 parents ed8dda4 + 416609e commit 93baecc
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ jobs:
matrix:
ruby-version: ['2.6', '2.7', '3.0', '3.1']
gemfile:
- Gemfile
- puma5
- puma5_capybara36
- puma6
exclude:
- ruby-version: '2.6'
gemfile: puma6
- ruby-version: '2.6'
gemfile: puma5
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ source 'http://rubygems.org'

gemspec

gem 'puma'
gem 'puma', '~> 6.0'
gem 'sinatra', '~> 2.0'
2 changes: 1 addition & 1 deletion capybara-mechanize.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |s|
s.require_paths = ['lib']
s.rubygems_version = '1.3.7'

s.add_runtime_dependency('capybara', ['>= 3.0.0', '< 3.37.0'])
s.add_runtime_dependency('capybara', ['>= 3.0.0', '< 4'])
s.add_runtime_dependency('mechanize', ['~> 2.8.5'])

s.add_development_dependency('launchy', ['>= 2.0.4'])
Expand Down
9 changes: 9 additions & 0 deletions gemfiles/puma5.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source 'http://rubygems.org'

gemspec path: '..'

gem 'capybara', '> 3.37'
gem 'puma', '~> 5.0'
gem 'sinatra', '~> 2.0'
9 changes: 9 additions & 0 deletions gemfiles/puma5_capybara36.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source 'http://rubygems.org'

gemspec path: '..'

gem 'capybara', '= 3.36'
gem 'puma', '~> 5.0'
gem 'sinatra', '~> 2.0'
9 changes: 9 additions & 0 deletions gemfiles/puma6.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

source 'http://rubygems.org'

gemspec path: '..'

gem 'capybara', '> 3.37'
gem 'puma', '~> 5.0'
gem 'sinatra', '~> 2.0'
2 changes: 1 addition & 1 deletion lib/capybara/mechanize/browser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def last_response
end

def last_request
last_request_remote? ? OpenStruct.new(request_method: @last_method, params: @last_params) : super
last_request_remote? ? OpenStruct.new(request_method: @last_method, params: @last_params, url: remote_response.current_url) : super
end

# For each of these http methods, we want to intercept the method call.
Expand Down
1 change: 1 addition & 0 deletions lib/capybara/mechanize/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

class Capybara::Mechanize::Node < Capybara::RackTest::Node
def click(keys = [], **options)
options.delete(:offset)
raise ArgumentError, 'The mechanize driver does not support click options' unless keys.empty? && options.empty?

submits = respond_to?(:submits?) ? submits? :
Expand Down

0 comments on commit 93baecc

Please sign in to comment.