Skip to content

Commit

Permalink
refactor(mocktail): resolve analysis warnings (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
felangel committed Dec 20, 2021
1 parent 461be1f commit eee9d4b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
6 changes: 2 additions & 4 deletions packages/mocktail/lib/src/_invocation_matcher.dart
Expand Up @@ -45,10 +45,8 @@ class InvocationMatcher {
for (final roleKey in roleInvocation.namedArguments.keys) {
final dynamic roleArg = roleInvocation.namedArguments[roleKey];
final dynamic actArg = invocation.namedArguments[roleKey];
if (roleArg is ArgMatcher) {
if (roleArg is ArgMatcher && roleArg._capture) {
_capturedArgs.add(actArg);
}
if (roleArg is ArgMatcher && roleArg._capture) {
_capturedArgs.add(actArg);
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions packages/mocktail/lib/src/mocktail.dart
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:collection/collection.dart';
import 'package:matcher/matcher.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';

Expand Down Expand Up @@ -397,12 +396,10 @@ List<VerificationResult> Function<T>(
_verificationInProgress = true;
return <T>(List<T Function()> _) {
for (final invocation in _) {
if (invocation is Function) {
try {
invocation();
} catch (_) {
if (_ is! TypeError) rethrow;
}
try {
invocation();
} catch (_) {
if (_ is! TypeError) rethrow;
}
}

Expand Down
@@ -1,4 +1,3 @@
import 'package:mocktail/mocktail.dart';
import 'package:mocktail/src/mocktail.dart';
import 'package:test/test.dart';

Expand Down
1 change: 0 additions & 1 deletion packages/mocktail/test/mocktail_test.dart
@@ -1,7 +1,6 @@
import 'dart:async';

import 'package:meta/meta.dart';
import 'package:mocktail/mocktail.dart';
import 'package:mocktail/src/mocktail.dart';
import 'package:test/test.dart';

Expand Down

0 comments on commit eee9d4b

Please sign in to comment.