| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.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 d.file. | 3 // BSD-style license that can be found in the LICENSE d.file. |
| 4 | 4 |
| 5 library pub_tests; | 5 library pub_tests; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:json' as json; | 8 import 'dart:json' as json; |
| 9 | 9 |
| 10 import 'descriptor.dart' as d; | 10 import 'descriptor.dart' as d; |
| 11 import 'test_pub.dart'; | 11 import 'test_pub.dart'; |
| 12 | 12 |
| 13 main() { | 13 main() { |
| 14 initConfig(); | 14 initConfig(); |
| 15 | 15 |
| 16 forBothPubInstallAndUpdate((command) { | 16 forBothPubInstallAndUpdate((command) { |
| 17 integration('fails gracefully on a dependency from an unknown source', () { | 17 integration('fails gracefully on a dependency from an unknown source', () { |
| 18 d.appDir([{"bad": "foo"}]).create(); | 18 d.appDir({"foo": {"bad": "foo"}}).create(); |
| 19 | 19 |
| 20 pubCommand(command, error: | 20 pubCommand(command, error: |
| 21 "Package 'myapp' depends on 'foo' from unknown source 'bad'."); | 21 "Package 'myapp' depends on 'foo' from unknown source 'bad'."); |
| 22 }); | 22 }); |
| 23 | 23 |
| 24 integration('fails gracefully on transitive dependency from an unknown ' | 24 integration('fails gracefully on transitive dependency from an unknown ' |
| 25 'source', () { | 25 'source', () { |
| 26 d.dir('foo', [ | 26 d.dir('foo', [ |
| 27 d.libDir('foo', 'foo 0.0.1'), | 27 d.libDir('foo', 'foo 0.0.1'), |
| 28 d.libPubspec('foo', '0.0.1', deps: [{"bad": "bar"}]) | 28 d.libPubspec('foo', '0.0.1', deps: {"bar": {"bad": "bar"}}) |
| 29 ]).create(); | 29 ]).create(); |
| 30 | 30 |
| 31 d.appDir([{"path": "../foo"}]).create(); | 31 d.appDir({"foo": {"path": "../foo"}}).create(); |
| 32 | 32 |
| 33 pubCommand(command, error: | 33 pubCommand(command, error: |
| 34 "Package 'foo' depends on 'bar' from unknown source 'bad'."); | 34 "Package 'foo' depends on 'bar' from unknown source 'bad'."); |
| 35 }); | 35 }); |
| 36 | 36 |
| 37 integration('ignores unknown source in lockfile', () { | 37 integration('ignores unknown source in lockfile', () { |
| 38 d.dir('foo', [ | 38 d.dir('foo', [ |
| 39 d.libDir('foo'), | 39 d.libDir('foo'), |
| 40 d.libPubspec('foo', '0.0.1') | 40 d.libPubspec('foo', '0.0.1') |
| 41 ]).create(); | 41 ]).create(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 | 69 |
| 70 // Should update to the new one. | 70 // Should update to the new one. |
| 71 d.dir(packagesPath, [ | 71 d.dir(packagesPath, [ |
| 72 d.dir("foo", [ | 72 d.dir("foo", [ |
| 73 d.file("foo.dart", 'main() => "foo";') | 73 d.file("foo.dart", 'main() => "foo";') |
| 74 ]) | 74 ]) |
| 75 ]).validate(); | 75 ]).validate(); |
| 76 }); | 76 }); |
| 77 }); | 77 }); |
| 78 } | 78 } |
| OLD | NEW |