Merge "Minor tweaks" PR #254 from Github.
PiperOrigin-RevId: 311417418
diff --git a/README.md b/README.md
index fe936d5..4dbe151 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+# mockito
+
Mock library for Dart inspired by [Mockito](https://github.com/mockito/mockito).
[![Pub](https://img.shields.io/pub/v/mockito.svg)](https://pub.dartlang.org/packages/mockito)
@@ -76,8 +78,8 @@
By default, any instance method of the mock instance returns `null`. The
[`when`], [`thenReturn`], [`thenAnswer`], and [`thenThrow`] APIs provide a
-stubbing mechanism to override this behavior. Once stubbed, the method will
-always return stubbed value regardless of how many times it is called. If a
+stubbing mechanism to override this behavior. Once stubbed, the method will
+always return stubbed value regardless of how many times it is called. If a
method invocation matches multiple stubs, the one which was declared last will
be used.
@@ -95,7 +97,7 @@
Instead, use `thenAnswer` to stub methods that return a `Future` or `Stream`.
-```
+```dart
// BAD
when(mock.methodThatReturnsAFuture())
.thenReturn(Future.value('Stub'));
@@ -113,7 +115,7 @@
If, for some reason, you desire the behavior of `thenReturn`, you can return a
pre-defined instance.
-```
+```dart
// Use the above method unless you're sure you want to create the Future ahead
// of time.
final future = Future.value('Stub');
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 2cdc67b..5a16769 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -5,15 +5,15 @@
linter:
rules:
- # Errors
- - comment_references
- - control_flow_in_finally
- - empty_statements
- - hash_and_equals
- - test_types_in_equals
- - throw_in_finally
+ # Errors
+ - comment_references
+ - control_flow_in_finally
+ - empty_statements
+ - hash_and_equals
+ - test_types_in_equals
+ - throw_in_finally
- # Style
- - await_only_futures
- - camel_case_types
- - non_constant_identifier_names
+ # Style
+ - await_only_futures
+ - camel_case_types
+ - non_constant_identifier_names