Thibaut Barrère
2011-Nov-08 16:45 UTC
[rspec-users] Wrong number of arguments (reduce, rspec/core/metadata)
Hello, I''m a bit puzzled on this one. I''m getting a wrong number of arguments on a reduce call (full stack trace here: https://gist.github.com/1348309). Any idea where it could come from? (I tried with 2.7.1 and 2.8.0.rc1). FWIW, it''s a Rails 2.3/RSpec 1 app that I''m migrating to Rails 3.0/RSpec 2. Any hint is most welcome! thanks, -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111108/25544c26/attachment.html>
David Chelimsky
2011-Nov-15 03:45 UTC
[rspec-users] Wrong number of arguments (reduce, rspec/core/metadata)
On Nov 8, 2011, at 10:45 AM, Thibaut Barr?re wrote:> Hello, > > I''m a bit puzzled on this one. > > I''m getting a wrong number of arguments on a reduce call (full stack trace here: https://gist.github.com/1348309). > > Any idea where it could come from? (I tried with 2.7.1 and 2.8.0.rc1). > > FWIW, it''s a Rails 2.3/RSpec 1 app that I''m migrating to Rails 3.0/RSpec 2. > > Any hint is most welcome! > > thanks, > > -- Thibautreduce has a number of different forms, one of which is collection.reduce { ... } (with a block but no args). My best guess is either your app or another lib/gem is redefining reduce. Possible?
Thibaut Barrère
2011-Nov-27 14:06 UTC
[rspec-users] Wrong number of arguments (reduce, rspec/core/metadata)
Hi David, reduce has a number of different forms, one of which is collection.reduce {> ... } (with a block but no args). >My best guess is either your app or another lib/gem is redefining reduce.> Possible? >well I don''t know the codebase enough yet, but I guess yes, it''s definitely possible. Thanks for the hint! (and sorry for the late reply - as I was newly subscribed to this group, I didn''t get your reply until I came back myself on the group). -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111127/05189f40/attachment.html>
Thibaut Barrère
2011-Nov-29 16:02 UTC
[rspec-users] Wrong number of arguments (reduce, rspec/core/metadata)
In case it helps someone else: I couldn''t find if the method was redefined by another class, but applying this patch solves the issue: https://github.com/rspec/rspec-core/commit/41c20dfc4e8bc99b6c7bba1e074883614d2aa656 (using inject instead of reduce). I''m on ruby 1.8.7 (2010-08-16 patchlevel 302). The issue happens with RSpec 2.7.0, but not with RSpec 2.5.0. -- Thibaut -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20111129/12f2a959/attachment.html>