-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Ruby 3.4 support? #2820
Comments
We typically add conditions around output to show the differences between Ruby versions. |
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 17, 2024
The fixes generally tries to leverage the native `Hash#inspect` behavior to remove the difference between Ruby 3.4 and older Rubies output. However, some of the case are peculiar due to `DescribableItem#inspect` \[[2]\] formatting. These needs special casing by `RUBY_VERSION` Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 17, 2024
The fixes generally tries to leverage the native `Hash#inspect` behavior to remove the difference between Ruby 3.4 and older Rubies output. However, some of the case are peculiar due to `DescribableItem#inspect` \[[2]\] formatting. These needs special casing by `RUBY_VERSION` Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 17, 2024
The fixes generally tries to leverage the native `Hash#inspect` behavior to remove the difference between Ruby 3.4 and older Rubies output. However, some of the case are peculiar due to `DescribableItem#inspect` \[[2]\] formatting. These needs special casing by `RUBY_VERSION` Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 17, 2024
The fixes generally tries to leverage the native `Hash#inspect` behavior to remove the difference between Ruby 3.4 and older Rubies output. However, some of the case are peculiar due to `DescribableItem#inspect` [[2]] formatting. These needs special casing by `RUBY_VERSION` Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 17, 2024
This fix keeps the new Ruby 3.4 formatting. To adjust the tests, it generally tries to leverage the native `Hash#inspect` behavior to remove the difference between Ruby 3.4 and older Rubies output. However, some of the case are peculiar due to `DescribableItem#inspect` [[2]] formatting. These needs special casing by `RUBY_VERSION` Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
voxik
added a commit
to voxik/rspec-rails
that referenced
this issue
Dec 18, 2024
This fix prefers the new Ruby 3.4 formatting then keeping the output backward compatibility. Fixes: rspec#2820 [1]: https://bugs.ruby-lang.org/issues/20433 [2]: https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Trying to run rspec-rails test suite against Ruby 3.4, I encounter test failures such as:
The error message seems to be originating from here:
rspec-rails/lib/rspec/rails/matchers/be_a_new.rb
Lines 29 to 43 in 609bb83
Specifically the
#{describe_unmatched_attributes.inspect}
. Here are some details frombinding.irb
:Obviously Ruby 3.4 changes the Hash formatting adding two spaces around hash rocket. The question is how to fix this. Several options:
Hash#inspect
BTW I find the hash like formatting with the brackets a bit unfortunate.
https://github.com/rspec/rspec/blob/60a7a65e195953196fb8d1836257909c56d2da85/rspec-expectations/lib/rspec/matchers/composable.rb#L162
The text was updated successfully, but these errors were encountered: