spumko/lab — pull request #30 by nlf (2013-08-26 20:21:09+00:00)
Title: Make Lab a global

The reason for this is to allow a globally installed lab to run tests.

As the module works now, if a user were to globally install lab to get the binary in their path and locally install lab in a project to be able to require it in their unit tests, the globally installed lab binary will not work and the user would be forced to run the lab binary from their local installation (i.e. ./node_modules/lab/bin/lab).

To see this for yourself, follow these steps

* create a new directory
* install lab globally ```npm i -g lab```
* install lab locally ```npm i lab```
* put the following code in test/example.js

```js
var Lab = require('lab');

Lab.experiment('example', function () {
Lab.test('does this run?', function (done) {
Lab.expect(1).to.equal(1);
done();
});
});
```

* run the command ```lab``` and see there are 0 tests completed
* run the command ```./node_modules/lab/bin/lab``` and see that 1 test is completed

After this pull request, end users would be able to use the lab binary from either a locally or globally installed copy to run their tests. The only other requirement would be to remove ```var Lab = require('lab');``` from their tests, since Lab is now provided as a global.