>> Puppet::Node.expects(:search).with("whatever", :class =>
>> "class", :fqdn => nil).returns([])
>
> This kind of call, especially, tends to be more resilient to changes
> when done something like:
>
> Puppet::Node.expects(:search).with { |name, args| args[:class] ==
> "class" }.returns nil
>
> Basically, the goal is to only test the bits whose behaviour you
> actually care about, and leave the rest unspecified.
>
> This way, if you add options later you don't have to go back and
> modify this test again.
>
> Probably not worth recutting the patch, but worth keeping in mind,
> especially when modifying existing tests.
Doh! I should know that. That's even on the code smell list. I am
not firing on all corners of my reuleaux triangle.
-- Markus
--
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en.