Merge branch 'issue-931-respy' of https://github.com/guy-mograbi-at-gigaspaces/jasmine into guy-mograbi-at-gigaspaces-issue-931-respy

- Merges #953
- Fixes #931
This commit is contained in:
Gregg Van Hove
2016-02-18 11:09:49 -08:00
4 changed files with 53 additions and 6 deletions

View File

@@ -677,6 +677,31 @@ describe("Env integration", function() {
env.execute();
});
it('can be configured to allow respying on functions', function () {
var env = new jasmineUnderTest.Env(),
foo = {
bar: function () {
return 1;
}
};
env.allowRespy(true);
env.describe('test suite', function(){
env.it('spec 0', function(){
env.spyOn(foo,'bar');
var error = null;
expect(function() {
env.spyOn(foo, 'bar');
}).not.toThrow();
});
});
env.execute();
});
it('removes all spies added in a spec after the spec is complete', function(done) {
var env = new jasmineUnderTest.Env(),
originalFoo = function() {},