fix recursively building specs collection

This commit is contained in:
Wouter Groeneveld 2011-06-28 09:05:41 +02:00
parent fcf2389df6
commit 38514a392d
3 changed files with 16 additions and 3 deletions

View File

@ -36,7 +36,7 @@ public class JasmineJSSuiteConverter {
specs.addAll(convertToJunitDescription(suite, suiteDescription));
NativeArray subSuites = (NativeArray) context.executeFunction(suite, "suites");
convertSuiteArrayToDescriptions(subSuites, suiteDescription, processed);
specs.addAll(convertSuiteArrayToDescriptions(subSuites, suiteDescription, processed));
}
}

View File

@ -16,7 +16,7 @@ public class DescriptionsRecursiveTreeInRunnerTest {
Description baseTestDescription = new JasmineTestRunner(RecursiveTreeTest.class).getDescription();
assertThat(baseTestDescription.getDisplayName()).contains(RecursiveTreeTest.class.getSimpleName());
assertThat(baseTestDescription.getChildren()).hasSize(1);
assertThat(baseTestDescription.getChildren()).hasSize(2);
Description root = baseTestDescription.getChildren().get(0);
assertThat(root.getDisplayName()).isEqualTo("root");
assertThat(root.getChildren()).hasSize(3);
@ -24,6 +24,12 @@ public class DescriptionsRecursiveTreeInRunnerTest {
assertThat(root.getChildren().get(0).getDisplayName()).isEqualTo("rootTest");
assertChild1AndChildren(root);
assertChild2AndChildren(root);
Description root2 = baseTestDescription.getChildren().get(1);
assertThat(root2.getDisplayName()).isEqualTo("root2");
assertThat(root2.getChildren()).hasSize(1);
assertThat(root2.getChildren().get(0).getDisplayName()).isEqualTo("root2Test");
}
private void assertChild2AndChildren(Description root) {

View File

@ -29,4 +29,11 @@ describe("root", function() {
});
});
});
describe("root2", function() {
it("root2Test", function() {
});
});