yui/yui3 — pull request #1531 by popox (2014-01-06 11:46:06+00:00)
Title: [YUI Testing framework] Mock only specific methods of objects and ability to call through original methods

Hello !

As per #442 with @trungpham and @hojberg, I come from a Jasmine background, thus have lacked quite a lot of functionnality with the YUI testing framework.

I could have simply used Jasmine to test my YUI project, but I thought that this functionality is to much of a must have in a testing framework.

__So here's what I've done:__
- Ability to stub only specific methods. ```var stub = Y.Mock(myObject, "myRealMethod")```
- Ability to call through the original methods when expecting something on a mock. ```Y.Mock.expect(stub, {method: "myRealMethod", callThrough: true, callCount: 1})```

Let me know if this is something you're looking into or if the YUI team never expects this kind of functionality for the Testing framework.

Cheers!
Paul