OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:io'; | 5 import 'dart:io'; |
6 | 6 |
7 import 'package:path/path.dart' as path; | 7 import 'package:path/path.dart' as path; |
8 import 'package:scheduled_test/descriptor.dart' as d; | 8 import 'package:scheduled_test/descriptor.dart' as d; |
9 import 'package:scheduled_test/scheduled_test.dart'; | 9 import 'package:scheduled_test/scheduled_test.dart'; |
10 | 10 |
11 import 'package:metatest/metatest.dart'; | |
12 import 'utils.dart'; | 11 import 'utils.dart'; |
13 | 12 |
14 void main() { | 13 void main() { |
15 expectTestPasses('file().create() creates a file', () { | 14 expectTestPasses('file().create() creates a file', () { |
16 scheduleSandbox(); | 15 scheduleSandbox(); |
17 | 16 |
18 d.file('name.txt', 'contents').create(); | 17 d.file('name.txt', 'contents').create(); |
19 | 18 |
20 schedule(() { | 19 schedule(() { |
21 expect(new File(path.join(sandbox, 'name.txt')).readAsString(), | 20 expect(new File(path.join(sandbox, 'name.txt')).readAsString(), |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 .writeAsString('barfoobaz'); | 182 .writeAsString('barfoobaz'); |
184 }); | 183 }); |
185 | 184 |
186 d.binaryMatcherFile('name.txt', contains(12)).validate(); | 185 d.binaryMatcherFile('name.txt', contains(12)).validate(); |
187 }, (error) { | 186 }, (error) { |
188 expect(error.toString(), equals( | 187 expect(error.toString(), equals( |
189 "Expected: contains <12>\n" | 188 "Expected: contains <12>\n" |
190 " Actual: [98, 97, 114, 102, 111, 111, 98, 97, 122]\n")); | 189 " Actual: [98, 97, 114, 102, 111, 111, 98, 97, 122]\n")); |
191 }); | 190 }); |
192 } | 191 } |
OLD | NEW |