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

guard-jruby-rspec broken for latest guard/guard-rspec 2.2.2 #38

Open
greghuc opened this issue Oct 30, 2013 · 12 comments
Open

guard-jruby-rspec broken for latest guard/guard-rspec 2.2.2 #38

greghuc opened this issue Oct 30, 2013 · 12 comments

Comments

@greghuc
Copy link

greghuc commented Oct 30, 2013

Hi there,

Upgrading guard to latest 2.2.2 breaks guard-jruby-rspec, which fails on 'guard' startup. Error message:

19:23:42 - ERROR - Invalid Guardfile, original error is:

[#] wrong number of arguments calling initialize (2 for 1)
ArgumentError: wrong number of arguments calling initialize (2 for 1)
initialize at /opt/rbenv/versions/jruby-1.7.5/lib/ruby/gems/shared/gems/guard-jruby-rspec-0.2.1/lib/guard/jruby-rspec.rb:42

Root cause is recent change to Guard::RSpec initializer, removing parameters:
https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec.rb#L11

Cheers

Greg

@greghuc
Copy link
Author

greghuc commented Oct 30, 2013

@jkutner
Copy link
Owner

jkutner commented Oct 30, 2013

Cool, can you submit a PR for this? I'll get it in ASAP and cut a release.

@greghuc
Copy link
Author

greghuc commented Oct 31, 2013

OK, I had an initial go at this, but I'm going to step away.

It seems that guard-rspec has also undergone a "compete rewrite", along with the changes in Guard 2.0.

My current level of knowledge of guard-jruby-rspec and these projects is sufficiently low that I'm likely to do more harm than good by attempting a fix right now. I'll leave this to someone with more understanding!

You can see the changes I made so far here:
https://github.com/greghuc/guard-jruby-rspec/compare/jkutner:master...master

Here's what I discovered:

Overview of Guard upgrade:
https://github.com/guard/guard/wiki/Upgrading-to-Guard-2.0

Changes to Guard::Rspec:

Guard::Rspec.run_all method logic has been pushed down into new Guard::RSpec::Runner.run_all method
And the Inspector object now lives inside Runner
Was: https://github.com/guard/guard-rspec/blob/v3.1.0/lib/guard/rspec.rb#L34
Now: https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec.rb#L26
=> Either implement Guard::JRubyRSpec::Runner.run_all, or maintain logic in Guard::JRubyRSpec.run_all

Guard::RSpec now uses run_on_modifications, not run_on_changes
Was: https://github.com/guard/guard-rspec/blob/v3.1.0/lib/guard/rspec.rb#L48
Now: https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec.rb#L34

Not sure if Guard::JRubyRSpec::Formatters::NotificationRSpec is necessary any more.
Guard::RSpec::Formatters::Notifier has an identical dump_summary method:
https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec/formatters/notifier.rb

@ruprict
Copy link
Contributor

ruprict commented Jan 27, 2014

Hit this problem too. FWIW, the following allows me to work:

gem "guard", "~>1.8.3"
gem "guard-rspec"
gem "guard-jruby-rspec", github: 'jkutner/guard-jruby-rspec'

Hope that helps people use this gem until a better fix is worked out.

@scottillogical
Copy link

+1

@swistaczek
Copy link

This error stil occurs in new version of guard

@vorakumar
Copy link

guard is now locked at revision 2.0+, any other solution to use guard-jruby-rspec??

@ianks
Copy link

ianks commented Jul 16, 2014

Having same issue as @vorakumar

@dmahlow
Copy link

dmahlow commented Sep 22, 2014

Locking the guard-rspec to an old version that still has guard 1.8 as a dependency seems to work as a workaround:

gem "guard", "~>1.8.3"
gem "guard-rspec", "~> 3.0.3"
gem "guard-jruby-rspec", github: 'jkutner/guard-jruby-rspec'

@nilbus
Copy link
Collaborator

nilbus commented Jan 22, 2015

guard-rspec 3.0.3 requires rspec 2. Since we've updated to rspec 3, I think I'll have to address this now. Thank you @greghuc for your initial attempt and for reporting back.

@nilbus
Copy link
Collaborator

nilbus commented Jan 22, 2015

I am implementing this in an rspec3 branch.

Todo:

  • Specify upper limits on gem versions we depend on in preparation for a 0.2.2 release, since this code is not compatible with guard-rspec-4.x
  • Update specs to use rspec 3 syntax via 2.99
  • Implement acceptance specs that will pass when guard is working, both before and after the update
  • Update the gemspec to require guard-rspec >= 4.0
  • Use the new guard-rspec API
  • Release guard-rspec 0.2.2 for compatibility with guard-rspec < 4.0 and rspec < 3.0
  • Release guard-rspec 1.0.0 for compatibility with guard-rspec >= 4.0 and rspec >= 3.0

@nilbus
Copy link
Collaborator

nilbus commented Feb 6, 2015

I got about as far in my rspec3 branch as greghuc did earlier when I found an easier way to support RSpec 3, which is my real goal. Updating is not straightforward, and someone still needs to address this. I'm opening #40 to address rspec 3 support.

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

No branches or pull requests

9 participants