-
-
Notifications
You must be signed in to change notification settings - Fork 754
Refining module fails with --format
and --require spec_helper
on Ruby 2.7
#2727
Comments
Wow, this would make an Interesting investigation. I would say if it works in pre-2.7 and broke in 2.7, it's a Ruby bug. Don't think we're able to work this around. |
This doesn't break if you just do So I'd like to keep this open until we've determined what, if anything we can do. |
A quick update on this: after poking around a little more I was surprised to find that this works if I refine @pirj I just created a ruby ticket here! And thanks for reopening @JonRowe -- this one is confusing and I'm not sure if it's a ruby issue or an rspec issue. The fact that bumping from ruby 2.6 to 2.7 causes this makes me think it's an underlying ruby issue, but the fact that removing the |
The specs fail with a `NoMethodError`, but it's a false error. Manually testing shows that the refinement still works on ruby 2.7. We have created issues in both rspec and ruby, since it's not clear where the underlying issue lives: rspec/rspec-core#2727 https://bugs.ruby-lang.org/issues/16852
The specs fail with a `NoMethodError`, but it's a false error. Manually testing shows that the refinement still works on ruby 2.7. We have created issues in both rspec and ruby, since it's not clear where the underlying issue lives: rspec/rspec-core#2727 https://bugs.ruby-lang.org/issues/16852
The specs fail with a `NoMethodError`, but it's a false error. Manually testing shows that the refinement still works on ruby 2.7. We have created issues in both rspec and ruby, since it's not clear where the underlying issue lives: rspec/rspec-core#2727 https://bugs.ruby-lang.org/issues/16852
Update! This is reproducible without rspec, and it's been determined that the reason Thank you for looking at this, I'll close it out in favor of the ruby issue. |
Great, I suspected it'd be something along those lines, thanks for coming back and closing this! |
Uh oh!
There was an error while loading. Please reload this page.
Refining module fails with
--format
and--require spec_helper
on Ruby 2.7I am attempting to test that a refinement to a module works as expected, but the refinement is seemingly not activated when using
rspec
with the--format
and--require
options on Ruby 2.7.1.Your environment
Failing
Succeeding
Succeeding
Steps to reproduce
I apologize for not including a single executable that can be run with
ruby
; this bug manifests only when using--format
and--require
options and I don't know how include thoserspec
options usingautorun
as the report template suggests. If there's a way to get this into a single executable then please let me know!These files describe a minimal example, here's a tarfile with this structure:
minimal_refinement_failure.tar.gz.
To reproduce, either create these files manually or download that tar file and run
tar -xzf minimal_refinement_failure.tar.gz
, which will create these in a directory namedminimal_refinement_failure
.Expected behavior
Actual behavior
Changes to example that result in expected behavior
Doing any of the following results in the expected output when running on ruby 2.7:
Enumerable
, refineArray
directly. This suggests that it's an issue only with refining modules, not classes.--require spec_helper
from the.rspec
file. (Or removing therequire_relative "../refinement_bug"
line from thespec_helper.rb
file.) This suggests that it's an issue with how files are required by the spec helper, since requiring the file directly in the spec succeeds.--format documentation
from the.rspec
file. I do not know why this would impact it, but it succeeds after doing this. (Notably, replacing with--format progress
also causes a failure -- it seems like the presence of the--format
flag causes the issue to manifest, rather than a specific value of--format
.)Output after doing any of the above:
Ruby issue
Since it seems like this might involve an unintended change in behavior from ruby 2.6 to 2.7,
I'll create an issue in the ruby bug trackerI created an issue in the ruby bug tracker here.Let me know if I can provide any more information!
The text was updated successfully, but these errors were encountered: