tj / should.js

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

Closes #53 - 'a' and 'an' is now similar, 'have.type' replaces 'be.a'. #126

Closed gabrielf closed 11 years ago

gabrielf commented 11 years ago

This fixes #53. However, after making the change it seems like there is no need for the 'a'. The 'an' method is useful for foo.should.be.an.instanceOf(Object). But when can 'a' be used with the current crop of matchers?

So just see this pull request as a part of the discussion. I'm not as sure anymore whether it is a good idea at all.

btd commented 11 years ago

All who ask about make a an alias for an use it like user.name.should.have.a.lengthOf(10)

btd commented 11 years ago

Need to fix docs also.

gabrielf commented 11 years ago

Good point! I'll fix the docs and make a testcase using lengthOf.

gabrielf commented 11 years ago

I've updated the Readme.md and the tests. I made sure that the chaining examples in the Readme uses all getters (a, an, have, be, and, with) and that they exists in the tests to make sure there were no typos.

btd commented 11 years ago

I have pulled this to v2. I will gather all new breaking changes to this branch for 2.0.0.