Skip to content

Commit

Permalink
test(annotations): fixed failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
gibahjoe committed Nov 8, 2024
1 parent 328c9da commit 4152aab
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void main() {
generatorName: Generator.dart,
);
expect(openapi.toString(),
contains('cleanSubOutputDirectory: [lib/src]'));
contains('cleanSubOutputDirectory: ["lib/src"]'));
});

test('should include skipSpecValidation when set', () {
Expand Down
8 changes: 5 additions & 3 deletions openapi-generator/test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,13 @@ Future<String> generateFromPath(

Future<String> generateFromAnnotation(Openapi openapi,
{ProcessRunner? process, String path = 'lib/myapp.dart'}) {
expect(openapi.inputSpec is RemoteSpec, isFalse,
reason: 'Please use a local spec for tests.');
String? specPath = null;
if (openapi.inputSpec is! RemoteSpec) {
specPath = openapi.inputSpec.path;
}
return generateFromSource(openapi.toString(),
process: process,
openapiSpecFilePath: openapi.inputSpec.path,
openapiSpecFilePath: specPath,
path: path);
}

Expand Down

0 comments on commit 4152aab

Please sign in to comment.