Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added patch (and tested) for fixing a bug in object literal equality …

…comparisons with isEqual
  • Loading branch information...
commit 49122cc83a3641b761beaa2f117c7e0bd79db4c1 1 parent 91ea29f
Alex Young authored
Showing with 16 additions and 3 deletions.
  1. +5 −0 README.textile
  2. +1 −1  riot.js
  3. +10 −2 test.js
View
5 README.textile
@@ -100,3 +100,8 @@ Note:
* <code>Riot.run()</code> will only run once, so you can include multiple Riot test files
* Specifying <code>Riot.run()</code> at the end of each test file lets you run that file with <code>js Riot.run()</code> in the console
+h3. Contributors
+
+* ac94 (Aron Carroll)
+* bgerrissen (Ben Gerrissen)
+
View
2  riot.js
@@ -491,7 +491,7 @@
}
}
}
- for (var key in a) {
+ for (var key in b) {
if (!this.isEqual(a[key], b[key])) {
return;
}
View
12 test.js
@@ -43,11 +43,19 @@ Riot.run(function() {
});
});
- context('1.2 yet another context', function() {
+ context('1.2. Equality', function() {
+ given('1.2.1. isEqual()', function () {
+ should('return falsy when an empty object is supplied as the first param', function() {
+ return ! Riot.Assertion.prototype.isEqual({}, {a: 'a', b: 'b'});
+ }).isTrue();
+ });
+ });
+
+ context('1.3 Yet another context', function() {
asserts('equals should compare strings as expected', 'test string').equals('test string');
});
- context('1.3 End', function() {
+ context('1.4 End', function() {
asserts('this test should appear at the end', true);
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.