OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 pubspec_test; | 5 library pubspec_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 | 8 |
9 import '../lib/src/pubspec.dart'; | 9 import '../lib/src/pubspec.dart'; |
10 import '../lib/src/source.dart'; | 10 import '../lib/src/source.dart'; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 expectFormatError(''' | 96 expectFormatError(''' |
97 dependencies: | 97 dependencies: |
98 foo: | 98 foo: |
99 mock: ok | 99 mock: ok |
100 dev_dependencies: | 100 dev_dependencies: |
101 foo: | 101 foo: |
102 mock: ok | 102 mock: ok |
103 '''); | 103 '''); |
104 }); | 104 }); |
105 | 105 |
| 106 test("throws if it dependes on itself", () { |
| 107 expectFormatError(''' |
| 108 name: myapp |
| 109 dependencies: |
| 110 myapp: |
| 111 mock: ok |
| 112 '''); |
| 113 }); |
| 114 |
| 115 test("throws if it has a dev dependency on itself", () { |
| 116 expectFormatError(''' |
| 117 name: myapp |
| 118 dev_dependencies: |
| 119 myapp: |
| 120 mock: ok |
| 121 '''); |
| 122 }); |
| 123 |
106 test("throws if the description isn't valid", () { | 124 test("throws if the description isn't valid", () { |
107 expectFormatError(''' | 125 expectFormatError(''' |
108 dependencies: | 126 dependencies: |
109 foo: | 127 foo: |
110 mock: bad | 128 mock: bad |
111 '''); | 129 '''); |
112 }); | 130 }); |
113 | 131 |
114 test("throws if 'name' is not a string", () { | 132 test("throws if 'name' is not a string", () { |
115 expectFormatError('name: [not, a, string]'); | 133 expectFormatError('name: [not, a, string]'); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 232 |
215 test("throws if the sdk isn't a valid version constraint", () { | 233 test("throws if the sdk isn't a valid version constraint", () { |
216 expectFormatError(''' | 234 expectFormatError(''' |
217 environment: | 235 environment: |
218 sdk: "oopies" | 236 sdk: "oopies" |
219 '''); | 237 '''); |
220 }); | 238 }); |
221 }); | 239 }); |
222 }); | 240 }); |
223 } | 241 } |
OLD | NEW |