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

Another failure to pass arguments when rspec loads files using Refinements #3826

Closed
estolfo opened this issue Apr 25, 2016 · 7 comments
Closed

Comments

@estolfo
Copy link

estolfo commented Apr 25, 2016

Summary

I opened this issue last week. The specific error noted in the issue description has indeed gone away with the fix applied in this commit but it seems that there is another issue.

This is the line from where the error is thrown.

This is the stack trace when I run rspec:

ArgumentError: wrong number of arguments calling `included` (0 for 1)
  <module:Validatable> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/validatable.rb:19
      <module:Mongoid> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/validatable.rb:15
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/validatable.rb:11
               require at org/jruby/RubyKernel.java:944
               require at /Users/emily/Code/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:120
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/composable.rb:1
               require at org/jruby/RubyKernel.java:944
               require at /Users/emily/Code/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:120
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/composable.rb:16
               require at org/jruby/RubyKernel.java:944
               require at /Users/emily/Code/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:120
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/document.rb:1
               require at org/jruby/RubyKernel.java:944
               require at /Users/emily/Code/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:120
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid/document.rb:16
               require at org/jruby/RubyKernel.java:944
               require at /Users/emily/Code/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:55
                 <top> at /Users/emily/Code/mongoid/mongoid/lib/mongoid.rb:1
                  load at org/jruby/RubyKernel.java:962
       block in (root) at /Users/emily/Code/mongoid/mongoid/lib/mongoid.rb:23
                  each at org/jruby/RubyArray.java:1593
                (root) at /Users/emily/Code/mongoid/mongoid/spec/spec_helper.rb:1
                (root) at /Users/emily/Code/mongoid/mongoid/spec/spec_helper.rb:8
                (root) at /Users/emily/Code/mongoid/mongoid/spec/mongoid/atomic/modifiers_spec.rb:1
                (root) at /Users/emily/Code/mongoid/mongoid/spec/mongoid/atomic/modifiers_spec.rb:1
                (root) at /Users/emily/Code/jruby/lib/ruby/gems/shared/gems/rspec-core-3.4.4/lib/rspec/core/configuration.rb:1
                 <top> at /Users/emily/Code/jruby/lib/ruby/gems/shared/gems/rspec-core-3.4.4/exe/rspec:4

Environment

@headius
Copy link
Member

headius commented Apr 27, 2016

Ok, so I suspect what's happening here is that it's finding the normal Module#included – which does require an argument – rather than some incuded you've refined into this body, yes?

This may be fixed by work I committed late last week and today that improves the search logic for refinements. I'll kick the snapshot build at http://ci.jrubyorg and you can let me know if it looks better.

@headius
Copy link
Member

headius commented Apr 28, 2016

Also...I didn't find (in quick inspection) any instructions on how to get up a test run. If I could run your suite it might be easy for me to shake out any remaining bugs.

@headius
Copy link
Member

headius commented Apr 28, 2016

Since this might have been fixed by additional work on refinements, and since we're running out of time for 9.1, I'm punting this to 9.1.1.0.

@estolfo Try to confirm last night's 9.1 snapshot. If it's still an issue and you can get us a way to reproduce it, we might be able to get it into 9.1.

@headius headius modified the milestones: JRuby 9.1.1.0, JRuby 9.1.0.0 Apr 28, 2016
@estolfo
Copy link
Author

estolfo commented Apr 28, 2016

Thanks so much for working on this, @headius
I haven't been able to test out the latest snapshot yet, but I don't want to hold you up. After some thought and further tests, I may not end up using Refinements. I've found some bizarre and unexpected behavior when on MRI that I'm not comfortable with introducing into Mongoid's codebase.
I'm happy to continue testing with my branch to help surface issues with Refinements in JRuby, but feel free to move forward with the 9.1 without my testing.

@headius
Copy link
Member

headius commented May 2, 2016

@estolfo I recommend that nobody ever use refinements, for exactly those reasons :-) We do appreciate having bug reports since it is a supported feature and we intend to make it work right.

If you are still able to verify this bug, that would be great. However, if you won't be able to verify or if you want to close the bug, that's fine too.

@estolfo
Copy link
Author

estolfo commented May 2, 2016

Hi @headius
As I decided to not use Refinements in Mongoid, I haven't had the chance to test and provide more information to the ticket over the last week. I'll have an update within the next day or two, otherwise, feel free to close and I'll open another ticket when I get back to it.
Thanks again!

@estolfo
Copy link
Author

estolfo commented May 9, 2016

I'm closing this and will open another issue when I have the chance to get back to trying out Refinements in Mongoid. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants