Permalink
Browse files

Added missing spec

  • Loading branch information...
1 parent 0b0594f commit eff4df890651a163d765ad19849b8c990674c2af @SteveSanderson SteveSanderson committed May 2, 2011
Showing with 16 additions and 1 deletion.
  1. +16 −1 spec/observableBehaviors.js
@@ -122,7 +122,22 @@ describe('Observable', {
instance.subscribe(notifiedValues.push, notifiedValues);
instance(constantObject);
value_of(notifiedValues).should_be([constantObject]);
- },
+ },
+
+ 'Should notify subscribers of a change even when an identical primitive is written if you\'ve set the equality comparer to null': function() {
+ var instance = new ko.observable("A");
+ var notifiedValues = [];
+ instance.subscribe(notifiedValues.push, notifiedValues);
+
+ // No notification by default
+ instance("A");
+ value_of(notifiedValues).should_be([]);
+
+ // But there is a notification if we null out the equality comparer
+ instance.equalityComparer = null;
+ instance("A");
+ value_of(notifiedValues).should_be(["A"]);
+ },
'Should ignore writes when the equalityComparer callback states that the values are equal': function() {
var instance = new ko.observable();

0 comments on commit eff4df8

Please sign in to comment.