Merge branch 'master' of ssh://github.com/jefklak/jasmine-junit-runner

This commit is contained in:
Wouter Groeneveld 2011-12-20 22:16:09 +01:00
commit 8bd88b62dd
2 changed files with 217 additions and 206 deletions

View File

@ -22,8 +22,8 @@ public class JasmineTestRunner extends Runner {
private JasmineDescriptions jasmineSuite; private JasmineDescriptions jasmineSuite;
private final RhinoContext rhinoContext; protected final RhinoContext rhinoContext;
private final JasmineSuite suiteAnnotation; protected final JasmineSuite suiteAnnotation;
private final Class<?> testClass; private final Class<?> testClass;
@JasmineSuite @JasmineSuite
@ -48,6 +48,9 @@ public class JasmineTestRunner extends Runner {
private RhinoContext setUpRhinoScope() { private RhinoContext setUpRhinoScope() {
RhinoContext context = new RhinoContext(); RhinoContext context = new RhinoContext();
pre(context);
context.loadEnv(suiteAnnotation.jsRootDir()); context.loadEnv(suiteAnnotation.jsRootDir());
setUpJasmine(context); setUpJasmine(context);
@ -56,6 +59,9 @@ public class JasmineTestRunner extends Runner {
return context; return context;
} }
protected void pre(RhinoContext context) {
}
private void setUpJasmine(RhinoContext context) { private void setUpJasmine(RhinoContext context) {
context.load(getJsLibDir() + "jasmine.js"); context.load(getJsLibDir() + "jasmine.js");
context.load(getJsLibDir() + "jasmine.delegator_reporter.js"); context.load(getJsLibDir() + "jasmine.delegator_reporter.js");
@ -138,9 +144,14 @@ public class JasmineTestRunner extends Runner {
} }
} }
after();
}
protected void after() {
this.rhinoContext.exit(); this.rhinoContext.exit();
} }
private Object createTestClassInstance() { private Object createTestClassInstance() {
try { try {
return testClass.newInstance(); return testClass.newInstance();

View File

@ -137,8 +137,8 @@ jasmine.JQuery.matchersClass = {};
return this.actual.find(selector).size() > 0; return this.actual.find(selector).size() > 0;
}, },
toBeDisabled: function(selector){ toBeDisabled: function(selector) {
return this.actual.attr("disabled") == true; return this.actual.is(':disabled');
} }
}; };