Hi.
I have a simple validation method as follows
function someMethod {
//some processing
}
I want to unit test this method. What is the simplest way I can mock it. Usually if I have an object as follows:
var someObject = function() {
reload : function() {
//reload logic here
}
}
I can stub someObject and then check if mock(someObject).should_receive("reload").exactly('once')
or something like that. But since this time I just have a method. How do I mock that?