Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Unified Diff: tools/dom/docs/test/docs_test.dart

Issue 13251005: Put in a teardown for the docs test, fixed dom.py to actually run it correctly, added PRESUMBIT. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/PRESUBMIT.py ('k') | tools/dom/dom.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+ });
});
}
« no previous file with comments | « tools/dom/PRESUBMIT.py ('k') | tools/dom/dom.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698