744 reputation
1826
bio website
location London, United Kingdom
age
visits member for 2 years, 5 months
seen May 22 at 18:55

May
12
accepted Are mocks in unit tests dangerous in dynamic languages?
May
12
answered Are mocks in unit tests dangerous in dynamic languages?
May
10
comment Are mocks in unit tests dangerous in dynamic languages?
lol, yep you are reading this right.
May
10
comment Are mocks in unit tests dangerous in dynamic languages?
My point is, when you are mocking and you have to stub out a methods return with an object, if you stub the wrong object type, your code could be calling a method on the returned object, which will be fine in test, but when in production (and the correct object type is used) that object will not have the same methods. Your production code will now be calling non existent methods which will throw an error.
May
10
revised Are mocks in unit tests dangerous in dynamic languages?
added 78 characters in body
May
10
comment Are mocks in unit tests dangerous in dynamic languages?
'it's the duck type that you should be the more concerned about.' that is my concern. What if SomeObject and SomeOtherObject had different methods (see update to question) i.e. they are not the same duck type
May
10
comment Are mocks in unit tests dangerous in dynamic languages?
Thanks for your answer. I'm not really sure what to take away from it though. My question wasn't about testing return types. It was about ensuring that any mocked method provides the correct object to the unit under test. Ive updated my question to hopefully explain
May
10
revised Are mocks in unit tests dangerous in dynamic languages?
added 14 characters in body
May
10
revised Are mocks in unit tests dangerous in dynamic languages?
added 14 characters in body
May
10
comment Are mocks in unit tests dangerous in dynamic languages?
...yes i know. What made you think i didn't?
May
9
asked Are mocks in unit tests dangerous in dynamic languages?
Apr
8
awarded  Famous Question
Feb
11
reviewed No Action Needed worst case comparisons for special case insertion sort
Feb
11
reviewed No Action Needed When should we use weak entities when modelling a database?
Feb
11
reviewed No Action Needed Any way to use VoltDB in rails app?
Feb
4
accepted RESTful Api: Send email with links to client URL
Feb
2
comment RESTful Api: Send email with links to client URL
But what is it? I've just done a quick google search and seems to be the REST API resources that are related to configuring a new client/partner. Is that right?
Feb
2
comment RESTful Api: Send email with links to client URL
What is all this talk of partner api? Its really confusing me. This is a client -> server / request -> response situation. There is no partner API!! (unless i've really missed something)
Feb
2
comment RESTful Api: Send email with links to client URL
I think i will make the client send it with each request. Seems more RESTful providing everything in one stateless request. Its also easier to inform clients of any resource which may now require a template email URI by returning a validation error if they don't provide one in the request.
Feb
2
comment RESTful Api: Send email with links to client URL
I'm not 100% sure on your question, can you rephrase?