Skip to content

Add Ruby 3.4 support #1657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
fail-fast: false
matrix:
ruby:
- head
- 3.3.0
- 3.2.2
- 3.1.4
Expand All @@ -40,6 +41,9 @@ jobs:
- sqlite3
- postgresql
exclude:
- { ruby: head, appraisal: rails_6_1 }
- { ruby: head, appraisal: rails_7_0 }
- { ruby: head, appraisal: rails_7_1 }
- { ruby: 3.3.0, appraisal: rails_6_1 }
- { ruby: 3.3.0, appraisal: rails_7_0 }
- { ruby: 3.2.2, appraisal: rails_6_1 }
Expand Down
4 changes: 2 additions & 2 deletions lib/shoulda/matchers/independent/delegate_method_matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def subject_handles_nil_delegate_object?
false
rescue NoMethodError => e
if e.message =~
/undefined method `#{delegate_method}' for nil/
/undefined method [`']#{delegate_method}' for nil/
false
else
raise e
Expand All @@ -468,7 +468,7 @@ def subject_handles_private_delegation?
false
rescue NoMethodError => e
if e.message =~
/private method `#{delegating_method}' called for/
/private method [`']#{delegating_method}' called for/
true
else
raise e
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it 'states that it should delegate method to the right object with right argument' do
matcher = delegate_method(:method_name).to(:delegate).
with_arguments(:foo, bar: [1, 2])
message = 'delegate #method_name to the #delegate object passing arguments [:foo, {:bar=>[1, 2]}]'
message = "delegate #method_name to the #delegate object passing arguments [:foo, #{{:bar=>[1, 2]}.to_s}]"

expect(matcher.description).to eq message
end
Expand Down Expand Up @@ -138,7 +138,7 @@ def country
it 'states that it should delegate method to the right object with right argument' do
matcher = delegate_method(:method_name).to(:delegate).
with_arguments(:foo, bar: [1, 2])
message = 'delegate .method_name to the .delegate object passing arguments [:foo, {:bar=>[1, 2]}]'
message = "delegate .method_name to the .delegate object passing arguments [:foo, #{{:bar=>[1, 2]}.to_s}]"

expect(matcher.description).to eq message
end
Expand Down Expand Up @@ -294,7 +294,7 @@ def mailman
context 'negating the matcher' do
it 'rejects with the correct failure message' do
post_office = PostOffice.new
message = 'Expected PostOffice not to delegate #deliver_mail to the #mailman object passing arguments ["221B Baker St.", {:hastily=>true}], but it did.'
message = "Expected PostOffice not to delegate #deliver_mail to the #mailman object passing arguments [\"221B Baker St.\", #{{:hastily=>true}.to_s}], but it did."

expect {
expect(post_office).
Expand All @@ -315,7 +315,7 @@ def mailman
'',
'Method calls sent to PostOffice#mailman:',
'',
'1) deliver_mail("221B Baker St.", {:hastily=>true})',
"1) deliver_mail(\"221B Baker St.\", #{{:hastily=>true}.to_s})"
].join("\n")

expect {
Expand Down
Loading