From 7c2052351263ddeb7afe2018dbd9d040ad8bf2e9 Mon Sep 17 00:00:00 2001 From: Aseem Kishore Date: Sat, 25 May 2013 13:00:16 -0300 Subject: [PATCH] eql(): fix wrong order of actual vs. expected. The helper `expect.eql()` function, like typical assertion methods, takes `actual` then `expected`: https://github.com/LearnBoost/expect.js/blob/master/expect.js#L850 But the `Assertion.prototype.eql` wrapper has been incorrectly passing `this.obj` (the object being tested) as the `expected`, and vice versa passing `obj` (the object used for comparison) as the `actual`. This fixes that. --- expect.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/expect.js b/expect.js index 58c7049..d8c4d9c 100644 --- a/expect.js +++ b/expect.js @@ -1,4 +1,3 @@ - (function (global, module) { if ('undefined' == typeof module) { @@ -212,7 +211,7 @@ Assertion.prototype.eql = function (obj) { this.assert( - expect.eql(obj, this.obj) + expect.eql(this.obj, obj) , function(){ return 'expected ' + i(this.obj) + ' to sort of equal ' + i(obj) } , function(){ return 'expected ' + i(this.obj) + ' to sort of not equal ' + i(obj) }); return this;