@@ -61,6 +61,9 @@ void main() {
61
61
} else if (invocation.positionalArguments[0 ][0 ] == 'show' ) {
62
62
final String response =
63
63
gitShowResponses[invocation.positionalArguments[0 ][1 ]];
64
+ if (response == null ) {
65
+ throw const io.ProcessException ('git' , < String > ['show' ]);
66
+ }
64
67
when < String > (mockProcessResult.stdout as String ).thenReturn (response);
65
68
} else if (invocation.positionalArguments[0 ][0 ] == 'merge-base' ) {
66
69
when < String > (mockProcessResult.stdout as String ).thenReturn ('abc123' );
@@ -150,6 +153,23 @@ void main() {
150
153
);
151
154
});
152
155
156
+ test ('allows valid version for new package.' , () async {
157
+ createFakePlugin ('plugin' , includeChangeLog: true , includeVersion: true );
158
+ gitDiffResponse = 'packages/plugin/pubspec.yaml' ;
159
+ gitShowResponses = < String , String > {
160
+ 'HEAD:packages/plugin/pubspec.yaml' : 'version: 1.0.0' ,
161
+ };
162
+ final List <String > output =
163
+ await runCapturingPrint (runner, < String > ['version-check' ]);
164
+
165
+ expect (
166
+ output,
167
+ containsAllInOrder (< String > [
168
+ 'No version check errors found!' ,
169
+ ]),
170
+ );
171
+ });
172
+
153
173
test ('denies invalid version without explicit base-sha' , () async {
154
174
createFakePlugin ('plugin' , includeChangeLog: true , includeVersion: true );
155
175
gitDiffResponse = 'packages/plugin/pubspec.yaml' ;
0 commit comments