tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 194 forks source link

added example for buffer support of eql() to readme #105

Closed bodokaiser closed 11 years ago

bodokaiser commented 11 years ago

There is no clue about should.eql() support buffers to. An example for this would be helpful.

bodokaiser commented 11 years ago

I now additionally added support for testing buffers against encoded strings (with tests of course):

(new Buffer('Hello')).should.eql('Hello');
(new Buffer[0x01, 0x02]).should.eql('AQI=');

PS: You really fucked me with actual and expected in _deepEqual(). They are turned round for some reason..

btd commented 11 years ago

IMHO strange idea: 1st why buffer vs. string and no string vs. buffer comparison and 2nd (more valuable) that why you think that buffer can be only in 'utf8' or 'base64' ?