psyho / bogus

Fake library for Ruby
Other
359 stars 14 forks source link

Interaction#==: properly compare arguments with custom #== implementations #9

Closed chastell closed 11 years ago

chastell commented 11 years ago

Interaction#any_args? calls #== on the tracked method’s arguments, rather than calling AnyArgs#==; this makes Interaction#== blow up when objects with custom #== are used as arguments.

This PR fixes this behaviour. :)

wrozka commented 11 years ago

Cool, thanks. Could you split the test into two examples and add the parenthesis to the struct definition to keep common style of coding? :)

chastell commented 11 years ago

Obviously! :) Do you have any particular coding/specing style written down anywhere? I’ll be happy to adjust.

wrozka commented 11 years ago

I guess we follow github's styleguide except the 1.9 hash syntax, which we often use. We don't indent arguments to the same line often, as you did in one of the commits in this PR, but I don't have strong opinion on that. ;)

chastell commented 11 years ago

Duly noted!

Does this mean you’ll accept a PR fixing block invocations (from foo {|bar| baz} to foo { |bar| baz })? :)

wrozka commented 11 years ago

We don't follow this guide strictly ;p My point was around parentheses, I skip them only in methods with no arguments or in assertions, added missing ones here: https://github.com/psyho/bogus/commit/5e0108d65d579896d0c3125c002b54eae0ecc3a4