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 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub | 5 /// Test infrastructure for testing pub. Unlike typical unit tests, most pub |
6 /// tests are integration tests that stage some stuff on the file system, run | 6 /// tests are integration tests that stage some stuff on the file system, run |
7 /// pub, and then validate the results. This library provides an API to build | 7 /// pub, and then validate the results. This library provides an API to build |
8 /// tests like that. | 8 /// tests like that. |
9 library test_pub; | 9 library test_pub; |
10 | 10 |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 args = flatten(['lish', '--server', tokenEndpoint, args]); | 417 args = flatten(['lish', '--server', tokenEndpoint, args]); |
418 return startPub(args: args, tokenEndpoint: tokenEndpoint); | 418 return startPub(args: args, tokenEndpoint: tokenEndpoint); |
419 } | 419 } |
420 | 420 |
421 /// Handles the beginning confirmation process for uploading a packages. | 421 /// Handles the beginning confirmation process for uploading a packages. |
422 /// Ensures that the right output is shown and then enters "y" to confirm the | 422 /// Ensures that the right output is shown and then enters "y" to confirm the |
423 /// upload. | 423 /// upload. |
424 void confirmPublish(ScheduledProcess pub) { | 424 void confirmPublish(ScheduledProcess pub) { |
425 // TODO(rnystrom): This is overly specific and inflexible regarding different | 425 // TODO(rnystrom): This is overly specific and inflexible regarding different |
426 // test packages. Should validate this a little more loosely. | 426 // test packages. Should validate this a little more loosely. |
427 expect(pub.nextLine(), completion(equals('Publishing "test_pkg" 1.0.0:'))); | 427 expect(pub.nextLine(), completion(startsWith( |
| 428 'Publishing "test_pkg" 1.0.0 to '))); |
428 expect(pub.nextLine(), completion(equals("|-- LICENSE"))); | 429 expect(pub.nextLine(), completion(equals("|-- LICENSE"))); |
429 expect(pub.nextLine(), completion(equals("|-- lib"))); | 430 expect(pub.nextLine(), completion(equals("|-- lib"))); |
430 expect(pub.nextLine(), completion(equals("| '-- test_pkg.dart"))); | 431 expect(pub.nextLine(), completion(equals("| '-- test_pkg.dart"))); |
431 expect(pub.nextLine(), completion(equals("'-- pubspec.yaml"))); | 432 expect(pub.nextLine(), completion(equals("'-- pubspec.yaml"))); |
432 expect(pub.nextLine(), completion(equals(""))); | 433 expect(pub.nextLine(), completion(equals(""))); |
433 expect(pub.nextLine(), completion(equals('Looks great! Are you ready to ' | 434 expect(pub.nextLine(), completion(equals('Looks great! Are you ready to ' |
434 'upload your package (y/n)?'))); | 435 'upload your package (y/n)?'))); |
435 | 436 |
436 pub.writeLine("y"); | 437 pub.writeLine("y"); |
437 } | 438 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 bool matches(item, Map matchState) { | 785 bool matches(item, Map matchState) { |
785 if (item is! Pair) return false; | 786 if (item is! Pair) return false; |
786 return _firstMatcher.matches(item.first, matchState) && | 787 return _firstMatcher.matches(item.first, matchState) && |
787 _lastMatcher.matches(item.last, matchState); | 788 _lastMatcher.matches(item.last, matchState); |
788 } | 789 } |
789 | 790 |
790 Description describe(Description description) { | 791 Description describe(Description description) { |
791 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); | 792 description.addAll("(", ", ", ")", [_firstMatcher, _lastMatcher]); |
792 } | 793 } |
793 } | 794 } |
OLD | NEW |