| 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('../../../lib/unittest/unittest.dart'); | 10 #import('../../../lib/unittest/unittest.dart'); |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 dir('foo', [ | 918 dir('foo', [ |
| 919 file('foo.dart', 'main() => "foo 2";') | 919 file('foo.dart', 'main() => "foo 2";') |
| 920 ]), | 920 ]), |
| 921 dir('bar', [ | 921 dir('bar', [ |
| 922 file('bar.dart', 'main() => "bar 2";') | 922 file('bar.dart', 'main() => "bar 2";') |
| 923 ]) | 923 ]) |
| 924 ]).scheduleValidate(); | 924 ]).scheduleValidate(); |
| 925 | 925 |
| 926 run(); | 926 run(); |
| 927 }); | 927 }); |
| 928 |
| 929 group("with an argument", () { |
| 930 test("updates one locked Git package but no others", () { |
| 931 ensureGit(); |
| 932 |
| 933 git('foo.git', [ |
| 934 file('foo.dart', 'main() => "foo";') |
| 935 ]).scheduleCreate(); |
| 936 |
| 937 git('bar.git', [ |
| 938 file('bar.dart', 'main() => "bar";') |
| 939 ]).scheduleCreate(); |
| 940 |
| 941 dir(appPath, [ |
| 942 file('pubspec.yaml', ''' |
| 943 dependencies: |
| 944 foo: |
| 945 git: ../foo.git |
| 946 bar: |
| 947 git: ../foo.git |
| 948 ''') |
| 949 ]).scheduleCreate(); |
| 950 |
| 951 schedulePub(args: ['install'], |
| 952 output: const RegExp(@"Dependencies installed!$")); |
| 953 |
| 954 dir(packagesPath, [ |
| 955 dir('foo', [ |
| 956 file('foo.dart', 'main() => "foo";') |
| 957 ]), |
| 958 dir('bar', [ |
| 959 file('bar.dart', 'main() => "bar";') |
| 960 ]) |
| 961 ]).scheduleValidate(); |
| 962 |
| 963 git('foo.git', [ |
| 964 file('foo.dart', 'main() => "foo 2";') |
| 965 ]).scheduleCommit(); |
| 966 |
| 967 git('bar.git', [ |
| 968 file('bar.dart', 'main() => "bar 2";') |
| 969 ]).scheduleCommit(); |
| 970 |
| 971 schedulePub(args: ['update foo'], |
| 972 output: const RegExp(@"Dependencies updated!$")); |
| 973 |
| 974 dir(packagesPath, [ |
| 975 dir('foo', [ |
| 976 file('foo.dart', 'main() => "foo 2";') |
| 977 ]), |
| 978 dir('bar', [ |
| 979 file('bar.dart', 'main() => "bar";') |
| 980 ]) |
| 981 ]).scheduleValidate(); |
| 982 |
| 983 run(); |
| 984 }); |
| 985 |
| 986 test("updates one locked Git package's dependencies", () { |
| 987 ensureGit(); |
| 988 |
| 989 git('foo.git', [ |
| 990 file('foo.dart', 'main() => "foo";'), |
| 991 file('pubspec.yaml', ''' |
| 992 dependencies: |
| 993 foo-dep: |
| 994 git: ../foo-dep.git |
| 995 ''') |
| 996 ]).scheduleCreate(); |
| 997 |
| 998 git('foo-dep.git', [ |
| 999 file('foo-dep.dart', 'main() => "foo-dep";') |
| 1000 ]).scheduleCreate(); |
| 1001 |
| 1002 git('bar.git', [ |
| 1003 file('bar.dart', 'main() => "bar";'), |
| 1004 file('pubspec.yaml', ''' |
| 1005 dependencies: |
| 1006 bar-dep: |
| 1007 git: ../bar-dep.git |
| 1008 ''') |
| 1009 ]).scheduleCreate(); |
| 1010 |
| 1011 git('bar-dep.git', [ |
| 1012 file('bar-dep.dart', 'main() => "bar-dep";') |
| 1013 ]).scheduleCreate(); |
| 1014 |
| 1015 dir(appPath, [ |
| 1016 file('pubspec.yaml', ''' |
| 1017 dependencies: |
| 1018 foo: |
| 1019 git: ../foo.git |
| 1020 bar: |
| 1021 git: ../foo.git |
| 1022 ''') |
| 1023 ]).scheduleCreate(); |
| 1024 |
| 1025 schedulePub(args: ['install'], |
| 1026 output: const RegExp(@"Dependencies installed!$")); |
| 1027 |
| 1028 dir(packagesPath, [ |
| 1029 dir('foo', [ |
| 1030 file('foo.dart', 'main() => "foo";'), |
| 1031 file('pubspec.yaml', ''' |
| 1032 dependencies: |
| 1033 foo-dep: |
| 1034 git: ../foo-dep.git |
| 1035 ''') |
| 1036 ]), |
| 1037 dir('foo-dep', [ |
| 1038 file('foo-dep.dart', 'main() => "foo-dep";') |
| 1039 ]), |
| 1040 dir('bar', [ |
| 1041 file('bar.dart', 'main() => "bar";'), |
| 1042 file('pubspec.yaml', ''' |
| 1043 dependencies: |
| 1044 bar-dep: |
| 1045 git: ../bar-dep.git |
| 1046 ''') |
| 1047 ]), |
| 1048 dir('bar-dep', [ |
| 1049 file('bar-dep.dart', 'main() => "bar-dep";') |
| 1050 ]) |
| 1051 ]).scheduleValidate(); |
| 1052 |
| 1053 git('foo-dep.git', [ |
| 1054 file('foo-dep.dart', 'main() => "foo-dep 2";') |
| 1055 ]).scheduleCommit(); |
| 1056 |
| 1057 git('bar-dep.git', [ |
| 1058 file('bar-dep.dart', 'main() => "bar-dep 2";') |
| 1059 ]).scheduleCommit(); |
| 1060 |
| 1061 schedulePub(args: ['update foo'], |
| 1062 output: const RegExp(@"Dependencies updated!$")); |
| 1063 |
| 1064 dir(packagesPath, [ |
| 1065 dir('foo', [ |
| 1066 file('foo.dart', 'main() => "foo";'), |
| 1067 file('pubspec.yaml', ''' |
| 1068 dependencies: |
| 1069 foo-dep: |
| 1070 git: ../foo-dep.git |
| 1071 ''') |
| 1072 ]), |
| 1073 dir('foo-dep', [ |
| 1074 file('foo-dep.dart', 'main() => "foo-dep 2";') |
| 1075 ]), |
| 1076 dir('bar', [ |
| 1077 file('bar.dart', 'main() => "bar";'), |
| 1078 file('pubspec.yaml', ''' |
| 1079 dependencies: |
| 1080 bar-dep: |
| 1081 git: ../bar-dep.git |
| 1082 ''') |
| 1083 ]), |
| 1084 dir('bar-dep', [ |
| 1085 file('bar-dep.dart', 'main() => "bar-dep";') |
| 1086 ]) |
| 1087 ]).scheduleValidate(); |
| 1088 |
| 1089 run(); |
| 1090 }); |
| 1091 }); |
| 928 } | 1092 } |
| 929 | 1093 |
| 930 versionCommand() { | 1094 versionCommand() { |
| 931 test('displays the current version', () => | 1095 test('displays the current version', () => |
| 932 runPub(args: ['version'], output: VERSION_STRING)); | 1096 runPub(args: ['version'], output: VERSION_STRING)); |
| 933 } | 1097 } |
| OLD | NEW |