spec/spec.modules.js in visionmedia-jspec-2.8.2 vs spec/spec.modules.js in visionmedia-jspec-2.8.3

- old
+ new

@@ -1,43 +1,40 @@ describe 'JSpec' describe 'module' describe 'hooks' - before_each - addedBeforeSpecHook = true + it 'should run beforeSpec' + addedBeforeSpec.should.be_true end - after_each - addedAfterSpecHook = true + it 'should run afterSpec' + addedAfterSpec.should.be_true end - it 'should run in context with beforeSpec' - addedBeforeSpec.should.be_true - addedAfterSpec.should.be_false - addedAfterSpecHook.should.be_false + describe 'with suites' + it 'should run beforeSuite' + addedBeforeSuite.should.be_true + end end - it 'should run beforeSpec BEFORE the before_each blocks' - addedBeforeSpecHook.should.be_true + it 'should run afterSuite' + addedAfterSuite.should.be_true end - - it 'should run in context with afterSpec' - addedBeforeSpec.should.be_true - addedAfterSpec.should.be_true + + it 'should run in context with JSpec' + hook('checkJSpecContext')[0].should.equal JSpec.each end - it 'should run afterSpec BEFORE after_each blocks' - addedAfterSpecHook.should.be_true + it 'should run in context to JSpecs default context' + hook('checkContext')[0].should.eql fixture('test') end - - it 'should run in context with beforeSuite' - addedBeforeSuite.should.be_true + + it 'should run in context to the module itself' + hook('checkModuleContext')[0].should.eql 'ExampleModule' end - - describe 'another suite' - it 'should run in context with afterSuite' - addedAfterSuite.should.be_true - end + + it 'should run in context to the modules utilities' + hook('checkUtilityContext')[0].should.eql 'foo' end end describe '.hook()' it 'should invoke hooks, returning an array of results' \ No newline at end of file