From 7b246a091ee7e6ac7da45022ba512d7a06d3b0cd Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 13 May 2024 13:20:25 -0400 Subject: [PATCH] test(shorebird_cli): coverage --- .../commands/patch/patch_command_test.dart | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart index f7e3f579..63e45158 100644 --- a/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/patch/patch_command_test.dart @@ -392,6 +392,25 @@ void main() { }); }); + group('when flutter install fails', () { + final error = Exception('Failed to install Flutter revision.'); + + setUp(() { + when( + () => shorebirdFlutter.installRevision( + revision: any(named: 'revision'), + ), + ).thenThrow(error); + }); + + test('exits with code 70', () async { + await expectLater( + () => runWithOverrides(command.run), + exitsWithCode(ExitCode.software), + ); + }); + }); + group('when release version is specified', () { setUp(() { when(() => argResults['release-version']).thenReturn(releaseVersion);