Skip to content

Commit

Permalink
Delint
Browse files Browse the repository at this point in the history
  • Loading branch information
joshperry committed Feb 25, 2015
1 parent c63def5 commit 4feb802
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
25 changes: 0 additions & 25 deletions lib/dirty-chai.js
Expand Up @@ -58,31 +58,6 @@
}
}

function callsAssert(getter) {
function fake() {
}

fake.then = function(resolve) { resolve({}); return this; }; // Stub to make chai-as-promised happy
fake.getCall = fake.calledWithExactly = function() { }; // Stub to make sinon-chai happy

var calledAssert = false;
var shim = new Assertion(fake);
shim.assert = function() { calledAssert = true; };

if(typeof getter === 'function') {
getter.call(shim);
/*
try {
getter.call(shim);
} catch(e) {
calledAssert = true;
}
*/
}

return calledAssert;
}

function convertAssertionPropertyToChainMethod(name, getter) {
if(getter) {
Assertion.addChainableMethod(name,
Expand Down
11 changes: 1 addition & 10 deletions test/dirty-chai.spec.js
Expand Up @@ -88,22 +88,13 @@ describe('dirty chai', function() {
});
});

it('should convert asserting property to a chainable method', function() {
it('should convert property to a chainable method', function() {
var prop = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'neverFail');
chai.Assertion.prototype.should.have.a.property('neverFail').and.should.be.a('function');
prop.should.have.property('get').and.be.a('function');
prop.get.call(new chai.Assertion({})).should.be.a('function');
});

it('should not convert asserting property to a chainable method', function() {
var obj = {};
var assertion = new chai.Assertion(obj);
var prop = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'flagelate');
chai.Assertion.prototype.should.have.a.property('flagelate').and.should.be.a('function');
prop.should.have.property('get').and.be.a('function');
prop.get.call(assertion).should.equal(assertion);
});

it('should call assertion', function() {
expect(true).to.neverFail();

Expand Down

0 comments on commit 4feb802

Please sign in to comment.