aboutsummaryrefslogtreecommitdiffstats
path: root/test/ScopeSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ScopeSpec.js')
-rw-r--r--test/ScopeSpec.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js
index ea63fea4..66e9d489 100644
--- a/test/ScopeSpec.js
+++ b/test/ScopeSpec.js
@@ -192,4 +192,27 @@ describe('scope/model', function(){
});
});
+
+ describe('$postEval', function(){
+ it('should eval function once and last', function(){
+ var log = '';
+ var scope = createScope();
+ function onceOnly(){log+= '@';}
+ scope.$onEval(function(){log+= '.';});
+ scope.$postEval(function(){log+= '!';});
+ scope.$postEval(onceOnly);
+ scope.$postEval(onceOnly);
+ scope.$postEval(); // ignore
+ scope.$eval();
+ expect(log).toEqual('.!@');
+ scope.$eval();
+ expect(log).toEqual('.!@.');
+
+ scope.$postEval(onceOnly);
+ scope.$postEval(onceOnly);
+ scope.$eval();
+ expect(log).toEqual('.!@..@');
+ });
+ });
+
});