Skip to content

Commit 9c1ebd0

Browse files
authored
Merge pull request #29 from jwren/new-description-frontmatter-assertion-3-26
Add description assertions to YAML asset tests
2 parents 91f4c0f + 9f939a6 commit 9c1ebd0

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tool/test/yaml_assets_test.dart

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ void main() {
9393
'All skills in flutter_skills.yaml must start with "flutter-"',
9494
);
9595
});
96+
97+
test('description contains "Flutter"', () {
98+
final description = item['description'] as String?;
99+
expect(
100+
description,
101+
isNotNull,
102+
reason: 'Skill must have a description',
103+
);
104+
expect(
105+
description,
106+
contains('Flutter'),
107+
reason:
108+
'All skills in flutter_skills.yaml must contain "Flutter" in their description',
109+
);
110+
});
96111
} else if (p.basename(file.path) == 'dart_skills.yaml') {
97112
test('name starting with "dart-"', () {
98113
expect(
@@ -101,6 +116,21 @@ void main() {
101116
reason: 'All skills in dart_skills.yaml must start with "dart-"',
102117
);
103118
});
119+
120+
test('description contains "Dart"', () {
121+
final description = item['description'] as String?;
122+
expect(
123+
description,
124+
isNotNull,
125+
reason: 'Skill must have a description',
126+
);
127+
expect(
128+
description,
129+
contains('Dart'),
130+
reason:
131+
'All skills in dart_skills.yaml must contain "Dart" in their description',
132+
);
133+
});
104134
}
105135

106136
group(name, () {

0 commit comments

Comments
 (0)