| 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:async'; | 5 import 'dart:async'; |
| 6 import 'package:barback/barback.dart'; | 6 import 'package:barback/barback.dart'; |
| 7 import 'package:observe/transform.dart'; | 7 import 'package:observe/transform.dart'; |
| 8 import 'package:unittest/compact_vm_config.dart'; | 8 import 'package:unittest/compact_vm_config.dart'; |
| 9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
| 10 | 10 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 expect(transform.outs, hasLength(1)); | 98 expect(transform.outs, hasLength(1)); |
| 99 expect(transform.outs[0].id, id); | 99 expect(transform.outs[0].id, id); |
| 100 return transform.outs.first.readAsString(); | 100 return transform.outs.first.readAsString(); |
| 101 }); | 101 }); |
| 102 }); | 102 }); |
| 103 } | 103 } |
| 104 | 104 |
| 105 class _MockTransform implements Transform { | 105 class _MockTransform implements Transform { |
| 106 List<Asset> outs = []; | 106 List<Asset> outs = []; |
| 107 Asset _asset; | 107 Asset _asset; |
| 108 AssetId get primaryId => _asset.id; | |
| 109 TransformLogger logger = new TransformLogger(false); | 108 TransformLogger logger = new TransformLogger(false); |
| 110 Future<Asset> get primaryInput => new Future.value(_asset); | 109 Asset get primaryInput => _asset; |
| 111 | 110 |
| 112 _MockTransform(this._asset); | 111 _MockTransform(this._asset); |
| 113 Future<Asset> getInput(Asset id) { | 112 Future<Asset> getInput(Asset id) { |
| 114 if (id == primaryId) return primaryInput; | 113 if (id == primaryInput.id) return new Future.value(primaryInput); |
| 115 fail(); | 114 fail(); |
| 116 } | 115 } |
| 117 | 116 |
| 118 void addOutput(Asset output) { | 117 void addOutput(Asset output) { |
| 119 outs.add(output); | 118 outs.add(output); |
| 120 } | 119 } |
| 121 } | 120 } |
| OLD | NEW |