diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b5817..6cb1abf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 4.5.1 +- Make `I should see an element for` and `I click on the element for` compatible for Ruby 3.0. ([#204](https://github.com/makandra/spreewald/issues/204)) + ## 4.5.0 - `patiently` retries one more time in certain edge cases where the alloted time was used up within the last retry of the `patiently` block (usually by Capybara). diff --git a/lib/spreewald/web_steps.rb b/lib/spreewald/web_steps.rb index dc727f9..bf0a820 100644 --- a/lib/spreewald/web_steps.rb +++ b/lib/spreewald/web_steps.rb @@ -279,7 +279,8 @@ expectation = negate ? :not_to : :to selector = _selector_for(locator) patiently do - expect(page).send(expectation, have_selector(*selector)) + args, kwargs = deconstruct_selector(selector) + expect(page).send(expectation, have_selector(*args, **kwargs)) end end.overridable(:priority => -5) # priority must be lower than the "within" step @@ -578,7 +579,8 @@ When /^I click on the element for (.+?)$/ do |locator| patiently do selector = _selector_for(locator) - page.find(*selector).click + args, kwargs = deconstruct_selector(selector) + page.find(*args, **kwargs).click end end.overridable(priority: -5) # priority lower than within diff --git a/lib/spreewald_support/version.rb b/lib/spreewald_support/version.rb index 6d391cf..21f2034 100644 --- a/lib/spreewald_support/version.rb +++ b/lib/spreewald_support/version.rb @@ -1,3 +1,3 @@ module Spreewald - VERSION = '4.5.0' + VERSION = '4.5.1' end diff --git a/tests/rails-7_capybara-3/Gemfile.lock b/tests/rails-7_capybara-3/Gemfile.lock index b426435..884172a 100644 --- a/tests/rails-7_capybara-3/Gemfile.lock +++ b/tests/rails-7_capybara-3/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: ../.. specs: - spreewald (4.4.4) + spreewald (4.5.1) cucumber cucumber_priority (>= 0.3.0) rspec (>= 2.13.0)