Chromium Code Reviews| Index: pkg/scheduled_test/test/descriptor/directory_test.dart |
| diff --git a/pkg/scheduled_test/test/descriptor/directory_test.dart b/pkg/scheduled_test/test/descriptor/directory_test.dart |
| index a8051cc58dabadc8ae62557a16068e399c55a9cf..caedf2cbf09e7317bf0adf37f4c2e84f4fec744d 100644 |
| --- a/pkg/scheduled_test/test/descriptor/directory_test.dart |
| +++ b/pkg/scheduled_test/test/descriptor/directory_test.dart |
| @@ -127,6 +127,7 @@ void main() { |
| test('test 2', () { |
| expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| expect(errors.length, equals(1)); |
| + // Error is _DirectoryValidationError. |
|
nweiz
2013/09/20 21:45:41
I don't think these comments are useful. The tests
Bill Hesse
2013/09/23 17:15:25
Done.
|
| expect(errors.first.error.toString(), |
| matches(r"^Directory not found: '[^']+[\\/]dir[\\/]subdir'\.$")); |
| }); |
| @@ -169,6 +170,7 @@ void main() { |
| test('test 2', () { |
| expect(errors, everyElement(new isInstanceOf<ScheduleError>())); |
| expect(errors.length, equals(1)); |
| + // Error is a _DirectoryValidationError. |
| expect(errors.first.error.toString(), |
| matches(r"^File not found: '[^']+[\\/]dir[\\/]file2\.txt'\.$")); |
| }); |
| @@ -300,9 +302,10 @@ void main() { |
| d.file('name.txt', 'contents') |
| ]); |
| - expect(dir.load('subdir').toList(), |
| - throwsA(equals("Couldn't find a readable entry named 'subdir' within " |
| - "'dir'."))); |
| + expect(dir.load('subdir').toList(), throwsA(allOf( |
| + new isInstanceOf<TestFailure>(), |
| + predicate((x) => x.message == |
| + "Couldn't find a readable entry named 'subdir' within 'dir'.")))); |
| }); |
| }); |
| @@ -331,9 +334,10 @@ void main() { |
| test('test', () { |
| var dir = d.dir('dir', [d.file('name.txt', 'contents')]); |
| - expect(dir.load('not-name.txt').toList(), |
| - throwsA(equals("Couldn't find a readable entry named 'not-name.txt' " |
| - "within 'dir'."))); |
| + expect(dir.load('not-name.txt').toList(), throwsA(allOf( |
| + new isInstanceOf<TestFailure>(), |
| + predicate((x) => x.message == "Couldn't find a readable entry " |
| + "named 'not-name.txt' within 'dir'.")))); |
| }); |
| }); |
| @@ -345,9 +349,10 @@ void main() { |
| d.file('name.txt', 'contents') |
| ]); |
| - expect(dir.load('name.txt').toList(), |
| - throwsA(equals("Found multiple readable entries named 'name.txt' " |
| - "within 'dir'."))); |
| + expect(dir.load('name.txt').toList(), throwsA(allOf( |
| + new isInstanceOf<TestFailure>(), |
| + predicate((x) => x.message == |
| + "Found multiple readable entries named 'name.txt' within 'dir'.")))); |
| }); |
| }); |
| @@ -412,4 +417,4 @@ void main() { |
| expect(d.dir('dir').describe(), equals('dir')); |
| }); |
| }); |
| -} |
| +} |