Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a bug related to enumerable is property on Object.prototype.

  • Loading branch information...
commit 5d8a653aa22c95d65a113d6c2de8d7e5005710cf 1 parent d327db2
@goloroden goloroden authored
Showing with 16 additions and 1 deletion.
  1. +2 −0  lib/assert.js
  2. +1 −1  package.json
  3. +13 −0 test/equalTo.js
View
2  lib/assert.js
@@ -5,6 +5,8 @@ var util = require('util');
var assert = require('assert'),
cmp = require('comparejs');
+Object.defineProperty(Object.prototype, 'is', { enumerable: false, writable: true });
+
Object.prototype.is = {
atLeast: function (expected) {
return function (actual) {
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "node-assertthat",
- "version": "0.0.18",
+ "version": "0.0.19",
"description": "node-assertthat provides a fluent TDD style for Node.js: assert.that(actual, is.equalTo(expected));",
"author": "Golo Roden <webmaster@goloroden.de> (http://www.goloroden.de)",
"main": "./lib/assert.js",
View
13 test/equalTo.js
@@ -2,6 +2,10 @@
var assert = require('../lib/assert.js');
+var Foo = function () {
+ this.bar = 'bar';
+};
+
suite('is.equalTo', function () {
test('equal => ok', function () {
assert.doesNotThrow(function () {
@@ -13,6 +17,15 @@ suite('is.equalTo', function () {
assert.that('foo', is.equalTo('bar'));
});
});
+ suite('for objects', function () {
+ test('equal => ok', function () {
+ assert.doesNotThrow(function () {
+ assert.that(new Foo(), is.equalTo({
+ bar: 'bar'
+ }));
+ });
+ });
+ });
});
suite('is.not.equalTo', function () {
Please sign in to comment.
Something went wrong with that request. Please try again.