John Feminella
2010-Jun-13 23:54 UTC
[rspec-users] Recommendations for ticket #971 workaround?
hello, I''m running rspec 1.3.0 on Ruby 1.9.2-dev. It appears that when you use `it` without a corresponding block, the test case is treated not as pending, but instead throws an error inside rspec. I see that there is a bug to this effect filed here: https://rspec.lighthouseapp.com/projects/5645/tickets/971-with-ruby-19-it-without-block-is-not-pending-but-throws-argumenterror Lines 79 through 81 of lib/spec/example/example_group_methods.rb look like this: def pending_implementation lambda { raise(Spec::Example::NotYetImplementedError) } end An argument is passed to the lambda in example_methods.rb. In Ruby 1.9.2, lambdas are stricter about the arguments they accept. In this case, to get the same behavior I think we probably want either `proc { ... }` or `lambda { |a*| ... }`. Given that the official patch isn''t in yet, do you recommend that people upgrade to rspec 2.0 (which appears not to have this problem), fall back to 1.9.1, or stay where they are and manually patch? Right now I''ve patched my example_group_methods.rb to be `proc` instead of `lambda`, but I always feel a little iffy when directly modifying my dependencies. - John