Skip to content
Browse files

fixed defect in equality matcher; it is not possible to do a recursiv…

…e match for objects as they may be cyclic
  • Loading branch information...
1 parent 81f9c3e commit 5438b3a558e619b52cadb854a18707109a284869 Nick Kallen committed May 3, 2008
Showing with 2 additions and 6 deletions.
  1. +2 −2 lib/screw.matchers.js
  2. +0 −4 spec/matchers_spec.js
View
4 lib/screw.matchers.js
@@ -23,9 +23,9 @@ Screw.Matchers = (function($) {
return actual.length == expected.length;
} else if (expected instanceof Object) {
for (var key in expected)
- if (!Screw.Matchers.equal.match(expected[key], actual[key])) return false;
+ if (expected[key] != actual[key]) return false;
for (var key in actual)
- if (!Screw.Matchers.equal.match(actual[key], expected[key])) return false;
+ if (actual[key] != expected[key]) return false;
return true;
} else {
return expected == actual;
View
4 spec/matchers_spec.js
@@ -12,10 +12,6 @@ Screw.Unit(function() {
expect({a: 'b', c: 'd', e: 'f'}).to_not(equal, {a: 'b', c: 'd', e: 'G'});
});
- it("recursively applies equality to complex elements", function() {
- expect({a: {b: 'c'}}).to(equal, {a: {b: 'c'}});
- expect({a: {b: 'c'}}).to_not(equal, {a: {b: 'D'}});
- });
});
describe('when given an array', function() {

0 comments on commit 5438b3a

Please sign in to comment.
Something went wrong with that request. Please try again.