Refactor suite to share reportExpectationFailure func

This was shared between our suite factory and the suite factory.
Sweet.
This commit is contained in:
Greg Cobb and Tim Jarratt
2014-08-27 13:50:56 -07:00
parent 35f52bcb24
commit cc3678f033

View File

@@ -183,9 +183,7 @@ getJasmineRequireObj().Env = function(j$) {
description: 'Jasmine__TopLevel__Suite', description: 'Jasmine__TopLevel__Suite',
queueRunner: queueRunnerFactory, queueRunner: queueRunnerFactory,
resultCallback: function() {}, // TODO - hook this up resultCallback: function() {}, // TODO - hook this up
reportExpectationFailure: function(message) { reportExpectationFailure: reportExpectationFailure
reporter.afterAllEvent('Expectation failed: '+ message);
}
}); });
runnableLookupTable[topSuite.id] = topSuite; runnableLookupTable[topSuite.id] = topSuite;
defaultResourcesForRunnable(topSuite.id); defaultResourcesForRunnable(topSuite.id);
@@ -242,9 +240,7 @@ getJasmineRequireObj().Env = function(j$) {
} }
reporter.suiteDone(attrs); reporter.suiteDone(attrs);
}, },
reportExpectationFailure: function(message) { reportExpectationFailure: reportExpectationFailure
reporter.afterAllEvent('Expectation failed: '+ message);
}
}); });
runnableLookupTable[suite.id] = suite; runnableLookupTable[suite.id] = suite;
@@ -365,6 +361,10 @@ getJasmineRequireObj().Env = function(j$) {
this.pending = function() { this.pending = function() {
throw j$.Spec.pendingSpecExceptionMessage; throw j$.Spec.pendingSpecExceptionMessage;
}; };
function reportExpectationFailure(message) {
reporter.afterAllEvent('Expectation failed: '+ message);
}
} }
return Env; return Env;