Index: tools/dom/docs/test/docs_test.dart |
diff --git a/tools/dom/docs/test/docs_test.dart b/tools/dom/docs/test/docs_test.dart |
index e87b2f6f4f93af8666efe4bace714d9694d5dbbd..3133fe79159f66a2bd57855be21520c3b76d5788 100644 |
--- a/tools/dom/docs/test/docs_test.dart |
+++ b/tools/dom/docs/test/docs_test.dart |
@@ -14,38 +14,42 @@ import '../lib/docs.dart'; |
final testJsonPath = scriptDir.append('test.json').canonicalize(); |
main() { |
- test('Ensure that docs.json is up to date', () { |
+ group('docs', () { |
var oldJson = new File.fromPath(json_path); |
var testJson = new File.fromPath(testJsonPath); |
- // We should find a json file where we expect it. |
- expect(oldJson.existsSync(), isTrue); |
+ tearDown(() { |
+ // Clean up. |
+ if (testJson.existsSync()) { |
+ testJson.deleteSync(); |
+ } |
+ assert(!testJson.existsSync()); |
+ }); |
- // Save the last modified time to check it at the end. |
- var oldJsonModified = oldJson.lastModifiedSync(); |
+ test('Ensure that docs.json is up to date', () { |
+ // We should find a json file where we expect it. |
+ expect(oldJson.existsSync(), isTrue); |
- // There should be no test file yet. |
- if (testJson.existsSync()) testJson.deleteSync(); |
- expect(testJson.existsSync(), isFalse); |
+ // Save the last modified time to check it at the end. |
+ var oldJsonModified = oldJson.lastModifiedSync(); |
- expect(convert(lib_path, testJsonPath) |
- .then((bool anyErrors) { |
- expect(anyErrors, isFalse); |
+ // There should be no test file yet. |
+ if (testJson.existsSync()) testJson.deleteSync(); |
+ assert(!testJson.existsSync()); |
- // We should have a file now. |
- expect(testJson.existsSync(), isTrue); |
+ expect(convert(lib_path, testJsonPath) |
+ .then((bool anyErrors) { |
+ expect(anyErrors, isFalse); |
- // Ensure that there's nothing different between the new JSON and old. |
- expect(testJson.readAsStringSync(), equals(oldJson.readAsStringSync())); |
+ // We should have a file now. |
+ expect(testJson.existsSync(), isTrue); |
- // Ensure that the old JSON file didn't actually change. |
- expect(oldJsonModified, equals(oldJson.lastModifiedSync())); |
+ // Ensure that there's nothing different between the new JSON and old. |
+ expect(testJson.readAsStringSync(), equals(oldJson.readAsStringSync())); |
- // Clean up. |
- if (testJson.existsSync()) { |
- testJson.deleteSync(); |
- } |
- expect(testJson.existsSync(), isFalse); |
- }), completes); |
+ // Ensure that the old JSON file didn't actually change. |
+ expect(oldJsonModified, equals(oldJson.lastModifiedSync())); |
+ }), completes); |
+ }); |
}); |
} |