Partial Mock/Fake in Cedar

33 views
Skip to first unread message

jby...@gmail.com

unread,
Feb 5, 2015, 11:35:10 AM2/5/15
to cedar-...@googlegroups.com
Hi,

I was wondering if there's a way of performing a partial fake in Cedar. More precisely, I would like to stub a method on an existing class instance while keeping the behaviours of the remaining methods. Certainly, I could refactor my code and remove this dependency into another class but I was wondering if this feature is available in Cedar (just for reference, it's the feature provided by partial mock in OCMock).

Thanks

JB

Andrew Kitchen

unread,
Feb 5, 2015, 12:14:24 PM2/5/15
to cedar-...@googlegroups.com
Hi JB,

It sounds like what you are looking for is Cedar's spy_on functionality.  if you spy_on this instance, you can stub methods as well as assert on received messages.


HTH

Andrew


--
You received this message because you are subscribed to the Google Groups "Cedar Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cedar-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sam Coward

unread,
Feb 5, 2015, 12:28:13 PM2/5/15
to cedar-...@googlegroups.com
I was just taking a quick review of the linked docs, and that section is a bit light on details about spies.

I added this paragraph, which I hope will help future readers:

jby...@kineticcafe.com

unread,
Feb 18, 2015, 3:58:52 PM2/18/15
to cedar-...@googlegroups.com
Thanks folks. Spy was exactly what I was looking for.
Reply all
Reply to author
Forward
0 new messages