Unverified Commit 2d4f5a98 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove mock from cmake project migrator (#76813)

parent 0c009425
...@@ -13,7 +13,7 @@ import 'package:flutter_tools/src/base/terminal.dart'; ...@@ -13,7 +13,7 @@ import 'package:flutter_tools/src/base/terminal.dart';
import 'package:flutter_tools/src/migrations/cmake_custom_command_migration.dart'; import 'package:flutter_tools/src/migrations/cmake_custom_command_migration.dart';
import 'package:flutter_tools/src/project.dart'; import 'package:flutter_tools/src/project.dart';
import 'package:meta/meta.dart'; import 'package:meta/meta.dart';
import 'package:mockito/mockito.dart'; import 'package:test/fake.dart';
import '../../src/common.dart'; import '../../src/common.dart';
...@@ -34,7 +34,7 @@ void main () { ...@@ -34,7 +34,7 @@ void main () {
group('migrate add_custom_command() to use VERBATIM', () { group('migrate add_custom_command() to use VERBATIM', () {
MemoryFileSystem memoryFileSystem; MemoryFileSystem memoryFileSystem;
BufferLogger testLogger; BufferLogger testLogger;
MockCmakeProject mockCmakeProject; FakeCmakeProject mockCmakeProject;
File managedCmakeFile; File managedCmakeFile;
setUp(() { setUp(() {
...@@ -49,8 +49,7 @@ void main () { ...@@ -49,8 +49,7 @@ void main () {
outputPreferences: OutputPreferences.test(), outputPreferences: OutputPreferences.test(),
); );
mockCmakeProject = MockCmakeProject(); mockCmakeProject = FakeCmakeProject(managedCmakeFile);
when(mockCmakeProject.managedCmakeFile).thenReturn(managedCmakeFile);
}); });
testWithoutContext('skipped if files are missing', () { testWithoutContext('skipped if files are missing', () {
...@@ -179,7 +178,12 @@ add_custom_command( ...@@ -179,7 +178,12 @@ add_custom_command(
}); });
} }
class MockCmakeProject extends Mock implements CmakeBasedProject {} class FakeCmakeProject extends Fake implements CmakeBasedProject {
FakeCmakeProject(this.managedCmakeFile);
@override
final File managedCmakeFile;
}
class FakeCmakeMigrator extends ProjectMigrator { class FakeCmakeMigrator extends ProjectMigrator {
FakeCmakeMigrator({@required this.succeeds}) FakeCmakeMigrator({@required this.succeeds})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment