OLD | NEW |
| (Empty) |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 library pub_tests; | |
6 | |
7 import '../descriptor.dart' as d; | |
8 import '../test_pub.dart'; | |
9 import 'utils.dart'; | |
10 | |
11 void main() { | |
12 initConfig(); | |
13 | |
14 integration("doesn't return a dependency's transformer that can't run on lib", | |
15 () { | |
16 d.dir(appPath, [ | |
17 d.pubspec({ | |
18 "name": "myapp", | |
19 "dependencies": {"foo": {"path": "../foo"}} | |
20 }) | |
21 ]).create(); | |
22 | |
23 d.dir("foo", [ | |
24 d.pubspec({ | |
25 "name": "foo", | |
26 "version": "1.0.0", | |
27 "transformers": [{"foo": {"\$include": "test/foo_test.dart"}}] | |
28 }), | |
29 d.dir("lib", [d.file("foo.dart", transformer())]), | |
30 d.dir("test", [d.file("foo_test.dart", "")]) | |
31 ]).create(); | |
32 | |
33 expectDependencies({}); | |
34 }); | |
35 | |
36 integration("does return the root package's transformer that can't run on " | |
37 "lib", () { | |
38 d.dir(appPath, [ | |
39 d.pubspec({ | |
40 "name": "myapp", | |
41 "transformers": [{"myapp": {"\$include": "test/myapp_test.dart"}}] | |
42 }), | |
43 d.dir("lib", [d.file("myapp.dart", transformer())]), | |
44 d.dir("test", [d.file("myapp_test.dart", "")]) | |
45 ]).create(); | |
46 | |
47 expectDependencies({"myapp": []}); | |
48 }); | |
49 | |
50 integration("does return a dependency's transformer that the root package " | |
51 "uses", () { | |
52 d.dir(appPath, [ | |
53 d.pubspec({ | |
54 "name": "myapp", | |
55 "dependencies": {"foo": {"path": "../foo"}}, | |
56 "transformers": [{"foo": {"\$include": "test/myapp_test.dart"}}] | |
57 }), | |
58 d.dir("test", [d.file("myapp_test.dart", "")]) | |
59 ]).create(); | |
60 | |
61 d.dir("foo", [ | |
62 d.pubspec({ | |
63 "name": "foo", | |
64 "version": "1.0.0" | |
65 }), | |
66 d.dir("lib", [d.file("foo.dart", transformer())]) | |
67 ]).create(); | |
68 | |
69 expectDependencies({"foo": []}); | |
70 }); | |
71 | |
72 integration("doesn't return a dependency's transformer that can run on bin", | |
73 () { | |
74 d.dir(appPath, [ | |
75 d.pubspec({ | |
76 "name": "myapp", | |
77 "dependencies": {"foo": {"path": "../foo"}} | |
78 }) | |
79 ]).create(); | |
80 | |
81 d.dir("foo", [ | |
82 d.pubspec({ | |
83 "name": "foo", | |
84 "version": "1.0.0", | |
85 "transformers": [{"foo": {"\$include": "bin/foo.dart"}}] | |
86 }), | |
87 d.dir("lib", [d.file("foo.dart", transformer())]), | |
88 d.dir("test", [d.file("foo_test.dart", "")]) | |
89 ]).create(); | |
90 | |
91 expectDependencies({"foo": []}); | |
92 }); | |
93 } | |
OLD | NEW |