Move clock from global to jasmine; provide a function to access the clock.

This commit is contained in:
Davis W. Frank
2013-10-10 16:24:58 -07:00
parent c28c124f58
commit 5aaafed4d8
5 changed files with 42 additions and 19 deletions

View File

@@ -91,8 +91,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
return env.spyOn(obj, methodName);
},
clock: env.clock,
addCustomEqualityTester: function(tester) {
env.addCustomEqualityTester(tester);
},
@@ -125,6 +123,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
return env.addMatchers(matchers);
};
/**
* Expose the mock interface for the JavaScript timeout functions
*/
jasmine.clock = function() {
return env.clock;
};
/**
* ## Runner Parameters
*

View File

@@ -69,8 +69,6 @@
return env.spyOn(obj, methodName);
},
clock: env.clock,
addCustomEqualityTester: function(tester) {
env.addCustomEqualityTester(tester);
},
@@ -103,6 +101,13 @@
return env.addMatchers(matchers);
};
/**
* Expose the mock interface for the JavaScript timeout functions
*/
jasmine.clock = function() {
return env.clock;
};
/**
* ## Runner Parameters
*