On Oct 18, 2008, at 10:30 AM, Stephen Eley wrote:

On Sat, Oct 18, 2008 at 12:53 AM, Scott Taylor
<[EMAIL PROTECTED]> wrote:

In Javascript, it might look more or less like this:

var old_method = obj[my_method];
my_obj[my_method] = my_return_value;

That's an interesting syntax comparison, thanks, but not really what I
was reacting to.  The statement of import (with emphasis added) was
""The dynamic nature of JavaScript makes mocking frameworks MOSTLY
UNNECESSARY."

This doesn't imply a simpler mocking framework, as you describe.  It
implies a fundamental mindshift in how testing gets done.

AH - that's interesting. I didn't take it as any sort of mindshift in testing. I thought that README/blogpost was simply saying that a mock framework is unnecessary because the syntax is so easy. But only *mostly* unnecessary, because either 1) there will be times where you'll need to tear things down, AND/OR 2) You could build a tiny stub/ mock framework around this stuff very easily for small syntactical gains.

Interesting idea, though, and maybe it does cause a mindshift in testing.

Scott
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to