@@ -141,23 +141,52 @@ void main() {
141
141
});
142
142
});
143
143
144
- test ('workspace members' , () async {
145
- final result = await testCommand (
146
- ['get' ],
147
- entities: {
148
- 'pubspec.yaml' : workspacePubspec,
149
- ...dartProject (workspace: true ),
150
- },
151
- );
152
- final stdout = result.stdout;
144
+ group ('workspace members' , () {
145
+ test ('if workspace in scope' , () async {
146
+ final result = await testCommand (
147
+ ['get' ],
148
+ entities: {
149
+ 'pubspec.yaml' : workspacePubspec,
150
+ ...dartProject (workspace: true ),
151
+ },
152
+ // Must link for workspace ref to exist
153
+ link: true ,
154
+ );
155
+ final stdout = result.stdout;
153
156
154
- expect (result.exitCode, ExitCode .success.code);
157
+ expect (result.exitCode, ExitCode .success.code);
158
+
159
+ // Pub get should run in the workspace
160
+ expectLine (
161
+ stdout,
162
+ ['Running "dart pub get" in current directory...' ],
163
+ );
164
+
165
+ // Pub get should NOT run in workspace members
166
+ expectLine (stdout, ['dart_puby_test' , 'Skip' ]);
167
+ });
168
+
169
+ test ('NOT if workspace out of scope' , () async {
170
+ final result = await testCommand (
171
+ ['get' ],
172
+ entities: {
173
+ 'pubspec.yaml' : workspacePubspec,
174
+ ...dartProject (workspace: true ),
175
+ },
176
+ workingPath: 'dart_puby_test' ,
177
+ // Must link for workspace ref to exist
178
+ link: true ,
179
+ );
180
+ final stdout = result.stdout;
155
181
156
- // Pub get should run in the workspace
157
- expectLine (stdout, ['Running "dart pub get" in current directory...' ]);
182
+ expect (result.exitCode, ExitCode .success.code);
158
183
159
- // Pub get should NOT run in workspace members
160
- expectLine (stdout, ['dart_puby_test' , 'Skip' ]);
184
+ // Pub get should run in the workspace member
185
+ expectLine (
186
+ stdout,
187
+ ['Running "dart pub get" in current directory...' ],
188
+ );
189
+ });
161
190
});
162
191
});
163
192
});
0 commit comments