Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Apr 27, 2021
1 parent 9e03927 commit 1b072a5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'dart:async';

import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:shared_preferences_linux/shared_preferences_linux.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Expand All @@ -30,10 +30,12 @@ void main() {
'flutter.List': <String>['baz', 'quox'],
};

SharedPreferencesLinux preferences;

SharedPreferencesStorePlatform preferences;

setUp(() {
preferences = SharedPreferencesLinux();
preferences = SharedPreferencesStorePlatform.instance;
expect(preferences.runtimeType.toString(), equals('SharedPreferencesLinux'));
});

tearDown(() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {

SharedPreferencesStorePlatform preferences;

setUp(() async {
setUp(() {
preferences = SharedPreferencesStorePlatform.instance;
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
platform :osx, '10.11'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_macos_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
// @dart=2.9

import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences_windows/shared_preferences_windows.dart';
import 'package:integration_test/integration_test.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_platform_interface.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
Expand All @@ -28,10 +28,11 @@ void main() {
'flutter.List': <String>['baz', 'quox'],
};

SharedPreferencesWindows preferences;
SharedPreferencesStorePlatform preferences;

setUp(() {
preferences = SharedPreferencesWindows();
preferences = SharedPreferencesStorePlatform.instance;
expect(preferences.runtimeType.toString(), equals('SharedPreferencesWindows'));
});

tearDown(() async {
Expand Down

0 comments on commit 1b072a5

Please sign in to comment.