visionmedia/should.js — Issue #45: Allow _(obj).should.not.exist syntax?
Author: alexeypetrushin
Created: 2012-01-31 21:24:33+00:00
State: open

Right now You has to include `should = require 'should'` at the every spec file, to be able to use it later like `should.exist(obj)` or `should.not.exist(obj)`.

It's not very convenient, and also it's style writing differs from all the other assertions. Maybe it's worth to allow alternate syntax

_(obj).should.not.exist

It may be added with this code:

``` CoffeeScript
should = require 'should'
Object.defineProperty should.Assertion.prototype, 'exist',
set: () ->
get: () ->
util = require 'util'
@assert null == this._wrapped,
'expected ' + util.inspect(this._wrapped) + ' to exist',
'expected ' + util.inspect(this._wrapped) + ' not to exist'
@
configurable: true
```