diff --git a/spec/error-reporter.coffee b/spec/error-reporter.coffee index b90562d..bc31c0e 100644 --- a/spec/error-reporter.coffee +++ b/spec/error-reporter.coffee @@ -147,10 +147,10 @@ describe 'Error reporter', -> ].join '\n' contextualError = stub.firstCall.args[0] - expect(contextualError).to.equal contextualErrorFixture - stub.restore() + expect(contextualError).to.equal contextualErrorFixture + context 'that does not have the previous line', -> it 'should provide the current and next line as context', -> sourceCode = 'ab'.split('').join '\n' @@ -172,10 +172,10 @@ describe 'Error reporter', -> ].join '\n' contextualError = stub.firstCall.args[0] - expect(contextualError).to.equal contextualErrorFixture - stub.restore() + expect(contextualError).to.equal contextualErrorFixture + context 'that does not have the next line', -> it 'should provide the previous and current line as context', -> sourceCode = 'ab'.split('').join '\n' @@ -197,10 +197,10 @@ describe 'Error reporter', -> ].join '\n' contextualError = stub.firstCall.args[0] - expect(contextualError).to.equal contextualErrorFixture - stub.restore() + expect(contextualError).to.equal contextualErrorFixture + context 'that has the previous and next line', -> it 'should provide the previous, current, and next line as context', -> sourceCode = 'abc'.split('').join '\n' @@ -223,10 +223,10 @@ describe 'Error reporter', -> ].join '\n' contextualError = stub.firstCall.args[0] - expect(contextualError).to.equal contextualErrorFixture - stub.restore() + expect(contextualError).to.equal contextualErrorFixture + describe 'when formatting', -> @@ -252,6 +252,6 @@ describe 'Error reporter', -> ].join '\n' contextualError = stub.firstCall.args[0] - expect(contextualError).to.equal contextualErrorFixture - stub.restore() + + expect(contextualError).to.equal contextualErrorFixture