From 958f617913014a224c7b552a4685e3571392bb11 Mon Sep 17 00:00:00 2001 From: Rexios Date: Fri, 11 Oct 2024 15:33:13 -0400 Subject: [PATCH] Group --no-fvm tests --- test/no_fvm_test.dart | 74 ++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/test/no_fvm_test.dart b/test/no_fvm_test.dart index 8d3faa1..bf5015e 100644 --- a/test/no_fvm_test.dart +++ b/test/no_fvm_test.dart @@ -9,41 +9,43 @@ import 'test_utils.dart'; const message = 'Project uses FVM, but FVM support is disabled'; void main() { - test('--no-fvm', () async { - final result = await testCommand(['get', '--no-fvm']); - final stdout = result.stdout; - - expect(result.exitCode, ExitCode.success.code); - expectLine(stdout, ['fvm_puby_test', message]); - // Ensure the FVM Flutter version was not used - expect( - File( - path.join( - result.workingDirectory, - 'fvm_puby_test', - '.dart_tool', - 'version', - ), - ).readAsStringSync(), - isNot('3.10.0'), - ); - }); - - test('--no-fvm on convenience command', () async { - final result = await testCommand(['mup', '--no-fvm']); - final stdout = result.stdout; - - expect(result.exitCode, ExitCode.success.code); - expectLine(stdout, ['fvm_puby_test', message]); - }); - - test('--no-fvm on link command', () async { - final result = await testCommand(['link', '--no-fvm']); - final stdout = result.stdout; - - expect(result.exitCode, ExitCode.success.code); - expectLine(stdout, ['fvm_puby_test', message]); - expectLine(stdout, [path.join('fvm_puby_test', 'example'), message]); - expectLine(stdout, [path.join('fvm_puby_test', 'nested'), message]); + group('--no-fvm', () { + test('on pub get', () async { + final result = await testCommand(['get', '--no-fvm']); + final stdout = result.stdout; + + expect(result.exitCode, ExitCode.success.code); + expectLine(stdout, ['fvm_puby_test', message]); + // Ensure the FVM Flutter version was not used + expect( + File( + path.join( + result.workingDirectory, + 'fvm_puby_test', + '.dart_tool', + 'version', + ), + ).readAsStringSync(), + isNot('3.10.0'), + ); + }); + + test('on convenience command', () async { + final result = await testCommand(['mup', '--no-fvm']); + final stdout = result.stdout; + + expect(result.exitCode, ExitCode.success.code); + expectLine(stdout, ['fvm_puby_test', message]); + }); + + test('on link command', () async { + final result = await testCommand(['link', '--no-fvm']); + final stdout = result.stdout; + + expect(result.exitCode, ExitCode.success.code); + expectLine(stdout, ['fvm_puby_test', message]); + expectLine(stdout, [path.join('fvm_puby_test', 'example'), message]); + expectLine(stdout, [path.join('fvm_puby_test', 'nested'), message]); + }); }); }