| 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 library barback.test.utils; | 5 library barback.test.utils; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; |
| 9 | 10 |
| 10 import 'package:barback/barback.dart'; | 11 import 'package:barback/barback.dart'; |
| 11 import 'package:barback/src/asset_graph.dart'; | 12 import 'package:barback/src/asset_graph.dart'; |
| 12 import 'package:pathos/path.dart' as pathos; | 13 import 'package:pathos/path.dart' as pathos; |
| 13 import 'package:scheduled_test/scheduled_test.dart'; | 14 import 'package:scheduled_test/scheduled_test.dart'; |
| 14 | 15 |
| 15 // TODO(rnystrom): Get rid of this or find a better path for it. | 16 // TODO(rnystrom): Get rid of this or find a better path for it. |
| 16 import '../../../sdk/lib/_internal/pub/test/command_line_config.dart'; | 17 import '../../../sdk/lib/_internal/pub/test/command_line_config.dart'; |
| 17 | 18 |
| 18 var _configured = false; | 19 var _configured = false; |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 451 } |
| 451 } | 452 } |
| 452 | 453 |
| 453 /// An implementation of [Asset] that never hits the file system. | 454 /// An implementation of [Asset] that never hits the file system. |
| 454 class MockAsset implements Asset { | 455 class MockAsset implements Asset { |
| 455 final AssetId id; | 456 final AssetId id; |
| 456 String contents; | 457 String contents; |
| 457 | 458 |
| 458 MockAsset(this.id, this.contents); | 459 MockAsset(this.id, this.contents); |
| 459 | 460 |
| 460 Future<String> readAsString() => new Future.value(contents); | 461 Future<String> readAsString({Encoding encoding}) => |
| 462 new Future.value(contents); |
| 463 |
| 461 Stream<List<int>> read() => throw new UnimplementedError(); | 464 Stream<List<int>> read() => throw new UnimplementedError(); |
| 462 | 465 |
| 463 serialize() => throw new UnimplementedError(); | |
| 464 | |
| 465 String toString() => "MockAsset $id $contents"; | 466 String toString() => "MockAsset $id $contents"; |
| 466 } | 467 } |
| OLD | NEW |