Duck type means that it will respond to that method, instance of will check
the class of the object.

Sent from my phone please excuse my brevity.

On 9 Jul 2014, at 09:41, Arup Rakshit <[email protected]> wrote:

Hi,

>From the doc
https://relishapp.com/rspec/rspec-mocks/v/3-0/docs/setting-constraints/matching-arguments

I found

with(duck_type(:each)) will match call like this - foo([])

But the same can be done also

with(instance_of(Array)) ->  foo([])

What is the difference between these 2 ?

Regards,
Arup Rakshit

-- 
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/CAKxHnE07XU87uRisRMiPn39ms0TLDF8hxT1JTgTE1EK1QFVziQ%40mail.gmail.com
<https://groups.google.com/d/msgid/rspec/CAKxHnE07XU87uRisRMiPn39ms0TLDF8hxT1JTgTE1EK1QFVziQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/-9030544115627558514%40unknownmsgid.
For more options, visit https://groups.google.com/d/optout.

Reply via email to