Skip to content

Commit

Permalink
[#186452398] Add Ruby 3 support for all _selector_for using steps (…
Browse files Browse the repository at this point in the history
…Issue #204)
  • Loading branch information
FLeinzi committed Nov 28, 2023
1 parent 72c7fe5 commit df68946
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
6 changes: 4 additions & 2 deletions lib/spreewald/web_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/spreewald_support/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Spreewald
VERSION = '4.5.0'
VERSION = '4.5.1'
end
2 changes: 1 addition & 1 deletion tests/rails-7_capybara-3/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit df68946

Please sign in to comment.