fix: update generated output for latest source_gen (dart-lang/pubspec_parse#12)
Also updated test code to use new TypeMatcher
diff --git a/pkgs/pubspec_parse/lib/src/dependency.g.dart b/pkgs/pubspec_parse/lib/src/dependency.g.dart
index 6133cb4..ed384a9 100644
--- a/pkgs/pubspec_parse/lib/src/dependency.g.dart
+++ b/pkgs/pubspec_parse/lib/src/dependency.g.dart
@@ -7,7 +7,7 @@
part of 'dependency.dart';
// **************************************************************************
-// Generator: JsonSerializableGenerator
+// JsonSerializableGenerator
// **************************************************************************
SdkDependency _$SdkDependencyFromJson(Map json) {
diff --git a/pkgs/pubspec_parse/lib/src/pubspec.g.dart b/pkgs/pubspec_parse/lib/src/pubspec.g.dart
index f585b84..921b7e4 100644
--- a/pkgs/pubspec_parse/lib/src/pubspec.g.dart
+++ b/pkgs/pubspec_parse/lib/src/pubspec.g.dart
@@ -7,7 +7,7 @@
part of 'pubspec.dart';
// **************************************************************************
-// Generator: JsonSerializableGenerator
+// JsonSerializableGenerator
// **************************************************************************
Pubspec _$PubspecFromJson(Map json) {
diff --git a/pkgs/pubspec_parse/pubspec.yaml b/pkgs/pubspec_parse/pubspec.yaml
index e6dbc4c..78dba00 100644
--- a/pkgs/pubspec_parse/pubspec.yaml
+++ b/pkgs/pubspec_parse/pubspec.yaml
@@ -19,6 +19,6 @@
json_serializable: ^0.5.7
path: ^1.5.1
stack_trace: ^1.9.2
- test: ^0.12.0
+ test: ^0.12.42
test_descriptor: ^1.0.3
test_process: ^1.0.2
diff --git a/pkgs/pubspec_parse/test/test_utils.dart b/pkgs/pubspec_parse/test/test_utils.dart
index 808d7c5..37cd3e9 100644
--- a/pkgs/pubspec_parse/test/test_utils.dart
+++ b/pkgs/pubspec_parse/test/test_utils.dart
@@ -15,14 +15,13 @@
String _encodeJson(Object input) =>
const JsonEncoder.withIndent(' ').convert(input);
-Matcher _throwsParsedYamlException(String prettyValue) => throwsA(allOf(
- const isInstanceOf<ParsedYamlException>(),
- new FeatureMatcher<ParsedYamlException>('formattedMessage', (e) {
+Matcher _throwsParsedYamlException(String prettyValue) =>
+ throwsA(const TypeMatcher<ParsedYamlException>().having((e) {
var message = e.formattedMessage;
printOnFailure("Actual error format:\nr'''\n$message'''");
_printDebugParsedYamlException(e);
return message;
- }, prettyValue)));
+ }, 'formattedMessage', prettyValue));
void _printDebugParsedYamlException(ParsedYamlException e) {
var innerError = e.innerError;
@@ -82,14 +81,3 @@
void expectParseThrows(Object content, String expectedError) => expect(
() => parse(content, quietOnError: true),
_throwsParsedYamlException(expectedError));
-
-// TODO(kevmoo) add this to pkg/matcher – is nice!
-class FeatureMatcher<T> extends CustomMatcher {
- final dynamic Function(T value) _feature;
-
- FeatureMatcher(String name, this._feature, matcher)
- : super('`$name`', '`$name`', matcher);
-
- @override
- Object featureValueOf(covariant T actual) => _feature(actual);
-}