-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix invalid YAML in .travis.yml (#887)
This also adds a test to verify that all YAML files are valid. Travis won't run tests at all if its YAML is invalid, but this way Appveyor can warn about broken Travis config and vice versa, and a local test run will warn about either.
- Loading branch information
Showing
2 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2019 Google Inc. Use of this source code is governed by an | ||
// MIT-style license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
@TestOn('vm') | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:path/path.dart' as p; | ||
import 'package:test/test.dart'; | ||
import 'package:yaml/yaml.dart'; | ||
|
||
void main() { | ||
group("YAML files are valid:", () { | ||
for (var entry in Directory.current.listSync()) { | ||
if (entry is File && | ||
(entry.path.endsWith(".yaml") || entry.path.endsWith(".yml"))) { | ||
test(p.basename(entry.path), () { | ||
// Shouldn't throw an error. | ||
loadYaml(entry.readAsStringSync()); | ||
}); | ||
} | ||
} | ||
}); | ||
} |