Mindspace/jasmine-as-promised — pull request #2 by sukima (2013-11-25 17:33:54+00:00)
Title: A few bug fixes (context and undefined checks)

When running the Q test suite all specs would fail complaining about `inject` being undefined.

Although there was a function wrapping said function it still was not defined and would cause a reference error well before the actual `isDefined()` function was called.

Considering the use of global variables the *is defined* lgic needs to be in the place of use and not proxied by a function.

Replace `isDefined()` with: (browser compatible syntax from CoffeeScript)

| Type | How to check |
|==========|========================================================|
| globals | `typeof variable !== 'undefined' && variable !== null` |
| function | `function(x) { return x != null; }` |
| property | `var x = {}; return !x.missing;` |

The jasmine `runs` function passes the context to the current Spec to it. This allows you to attach properties to this and have it available inside the `runs` function. Because of this variable you want to define in the `beforeEach` are accessible.

Add specs around this to be sure that the context is set.