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('pub_tests'); | 5 #library('pub_tests'); |
6 | 6 |
7 #import('dart:io'); | 7 #import('dart:io'); |
8 | 8 |
9 #import('test_pub.dart'); | 9 #import('test_pub.dart'); |
10 #import('../../../pkg/unittest/unittest.dart'); | 10 #import('../../../pkg/unittest/unittest.dart'); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 file('foo.dart', 'main() => "foo";') | 71 file('foo.dart', 'main() => "foo";') |
72 ]), | 72 ]), |
73 dir('bar', [ | 73 dir('bar', [ |
74 file('bar.dart', 'main() => "bar";') | 74 file('bar.dart', 'main() => "bar";') |
75 ]) | 75 ]) |
76 ]).scheduleValidate(); | 76 ]).scheduleValidate(); |
77 | 77 |
78 run(); | 78 run(); |
79 }); | 79 }); |
80 | 80 |
81 test('requires the repository name to match the name in the pubspec', () { | |
82 ensureGit(); | |
83 | |
84 git('foo.git', [ | |
85 file('foo.dart', 'main() => "foo";') | |
86 ]).scheduleCreate(); | |
87 | |
88 dir(appPath, [ | |
89 pubspec({ | |
90 "name": "myapp", | |
91 "dependencies": { | |
92 "weird-name": {"git": "../foo.git"} | |
93 } | |
94 }) | |
95 ]).scheduleCreate(); | |
96 | |
97 // TODO(nweiz): clean up this RegExp when either issue 4706 or 4707 is | |
98 // fixed. | |
99 schedulePub(args: ['install'], | |
100 error: const RegExp(@'^FormatException: The name you specified for ' | |
101 @'your dependency, "weird-name", doesn' @"'" @'t match the name ' | |
102 @'"foo" \(from "\.\./foo\.git"\)\.')); | |
103 | |
104 run(); | |
105 }); | |
106 | |
81 test('checks out and updates a package from Git', () { | 107 test('checks out and updates a package from Git', () { |
82 ensureGit(); | 108 ensureGit(); |
83 | 109 |
84 git('foo.git', [ | 110 git('foo.git', [ |
85 file('foo.dart', 'main() => "foo";') | 111 file('foo.dart', 'main() => "foo";') |
86 ]).scheduleCreate(); | 112 ]).scheduleCreate(); |
87 | 113 |
88 appDir([{"git": "../foo.git"}]).scheduleCreate(); | 114 appDir([{"git": "../foo.git"}]).scheduleCreate(); |
89 | 115 |
90 schedulePub(args: ['install'], | 116 schedulePub(args: ['install'], |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
303 output: const RegExp(@"Dependencies installed!$")); | 329 output: const RegExp(@"Dependencies installed!$")); |
304 | 330 |
305 dir(packagesPath, [ | 331 dir(packagesPath, [ |
306 dir('foo', [ | 332 dir('foo', [ |
307 file('foo.dart', 'main() => "foo 1.0.0";') | 333 file('foo.dart', 'main() => "foo 1.0.0";') |
308 ]) | 334 ]) |
309 ]).scheduleValidate(); | 335 ]).scheduleValidate(); |
310 | 336 |
311 run(); | 337 run(); |
312 }); | 338 }); |
339 | |
340 group("(regression)", () { | |
Bob Nystrom
2012/08/24 21:03:16
I don't think this group() adds much. Every test i
nweiz
2012/08/24 21:09:20
I think there's a useful distinction between tests
| |
341 test('checks out a package from Git with a trailing slash', () { | |
342 ensureGit(); | |
343 | |
344 git('foo.git', [ | |
345 file('foo.dart', 'main() => "foo";') | |
346 ]).scheduleCreate(); | |
347 | |
348 appDir([{"git": "../foo.git/"}]).scheduleCreate(); | |
349 | |
350 schedulePub(args: ['install'], | |
351 output: const RegExp(@"Dependencies installed!$")); | |
352 | |
353 dir(cachePath, [ | |
354 dir('git', [ | |
355 dir('cache', [gitPackageCacheDir('foo')]), | |
356 gitPackageCacheDir('foo') | |
357 ]) | |
358 ]).scheduleValidate(); | |
359 | |
360 dir(packagesPath, [ | |
361 dir('foo', [ | |
362 file('foo.dart', 'main() => "foo";') | |
363 ]) | |
364 ]).scheduleValidate(); | |
365 | |
366 run(); | |
367 }); | |
368 }); | |
313 } | 369 } |
OLD | NEW |