-
-
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
[WIP] Enable CI for Ruby head #2821
Conversation
.github/workflows/ci.yml
Outdated
@@ -45,6 +45,9 @@ jobs: | |||
RAILS_VERSION: 'main' | |||
|
|||
# Rails 8.0 builds >= 3.2 | |||
- ruby: head |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if you used one of the preview versions
e7aeecf
to
cb28b10
Compare
Eh, ok. Failure due to:
|
f6e5c3b
to
f5fd11e
Compare
The Ruby 3.0 tests become broken since yesterday apparently due to RubyGems update 🤷 |
Not sure about the |
Yeah, not sure about Rubocop. Maybe using the |
@@ -178,7 +200,7 @@ def new_record?; false; end | |||
expect(record).to be_a_new(String).with(foo: 'bar') | |||
}.to raise_error( | |||
"expected #{record.inspect} to be a new String and " + | |||
%(attribute {"foo"=>"bar"} was not set on #{record.inspect}) | |||
%(attribute #{{"foo"=>"bar"}} was not set on #{record.inspect}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would extract this to a variable which is defined based on a condition and pass that to raise_error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please elaborate a bit more about the reasons? As I see it, the main advantage of this approach is that the string is still very much reminds the error output. OTOH, if this is extracted into variable, it might have the benefit that Rubocop is happier. Besides that, I'd need to come up with some reasonable variable name, which is always the worst task 🙈
And also is this remark specific to this hunk or in general?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its in general for these interpolated hunks after your rubocop comment e.g.
message =
if RUBY_VERSION >= '3.4'
%(attribute {foo: "bar"} was not set on #{record.inspect})
else
%(attribute {"foo"=>"bar"} was not set on #{record.inspect})
end
...
}.to raise_error(message)
If you rebase this the main branch fixed the rubygems errors |
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
Rubocop is happy now 👍 But I am not exactly sure about the remaining failures for Ruby 3.4 / Rails 8.0 🤷 |
I've probably fixed the two issues in #2825 |
Thanks @voxik |
This is just to demonstrate the Ruby 3.4 errors discussed in #2820