Skip to content

Commit

Permalink
Group --no-fvm tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexios80 committed Oct 11, 2024
1 parent df68807 commit 958f617
Showing 1 changed file with 38 additions and 36 deletions.
74 changes: 38 additions & 36 deletions test/no_fvm_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
});
});
}

0 comments on commit 958f617

Please sign in to comment.