Re: Expectations and Parameters

43 views
Skip to first unread message

Peter Niederwieser

unread,
Jul 6, 2013, 11:41:40 AM7/6/13
to spockfr...@googlegroups.com
The general idea is to demand as little as necessary to gain confidence in the code under test. (Or, if you view it as a design activity, as little as necessary to capture the "essential" interaction.) If in doubt, leave it out. In interaction-based tests, there is a very real risk of littering tests with implementation details that don't really matter, resulting in brittle tests that break whenever you make a seemingly harmless change to the code under test.

Cheers,
Peter

Am Dienstag, 21. Mai 2013 21:45:36 UTC+2 schrieb Bob Corcoran:

Regarding expections, are there best practices on when to give a parameter a type, no type or
an implemetation of a type? 

1 * someObject.write(_) >> returnValue

1 * someObject.write(_ as anObject) >> returnValue

1 * someObject.write(anObjectImpl) >> returnValue

Reply all
Reply to author
Forward
0 new messages