Skip to content
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

Add tests with Ruby 3.4 #585

Merged
merged 1 commit into from
Mar 13, 2025
Merged

Add tests with Ruby 3.4 #585

merged 1 commit into from
Mar 13, 2025

Conversation

zendesk-ops-ci
Copy link

@zendesk-ops-ci zendesk-ops-ci commented Jan 7, 2025

Adds tests with Ruby 3.4.

Updates a spec that checks User#inspect output to work with the new Hash#inspect behaviour: ruby/ruby#10924

@razumau razumau force-pushed the ruby_3.4 branch 2 times, most recently from c70a11d to a4a839c Compare January 8, 2025 16:04
Updates a spec that checks User#inspect output to work with the new Hash#inspect behaviour: ruby/ruby#10924
Comment on lines +458 to +463
expected_user_representation = if RUBY_VERSION >= "3.4"
"#<ZendeskAPI::User {\"foo\" => :bar}>"
else
"#<ZendeskAPI::User {\"foo\"=>:bar}>"
end
expect(ZendeskAPI::User.new(client, :foo => :bar).inspect).to eq(expected_user_representation)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done differently:

expect(ZendeskAPI::User.new(client, :foo => :bar).inspect).to eq("#<ZendeskAPI::User #{{'foo' => :bar}}>")

That is, we interpolate a hash directly in the expected output, and it match Hash#inspect behaviour. However, here we only have one such test, and we explicitly are interested in how User#inspect behaves, so I thought it would be better to have two branches.

@razumau razumau marked this pull request as ready for review January 10, 2025 14:29
@razumau razumau requested a review from a team as a code owner January 10, 2025 14:29
@razumau razumau merged commit 0c5c445 into master Mar 13, 2025
8 checks passed
@razumau razumau deleted the ruby_3.4 branch March 13, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants