Merge branch 'stable'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d61162..13aa2a9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,15 @@
`configureExpectFailureHandler`, and `getOrCreateExpectFailureHandler`.
Now that `expect` is in the `unittest` package, these are no longer needed.
+## 0.11.4+4
+
+* Deprecate the name parameter to `isInstanceOf`. All language implementations
+ now support converting the type parameter to a string directly.
+
+## 0.11.4+3
+
+* Fix the examples for `equalsIgnoringWhitespace`.
+
## 0.11.4+2
* Improve the formatting of strings that contain unprintable ASCII characters.
diff --git a/lib/src/core_matchers.dart b/lib/src/core_matchers.dart
index 61585bc..a2e9718 100644
--- a/lib/src/core_matchers.dart
+++ b/lib/src/core_matchers.dart
@@ -372,23 +372,15 @@
/// 'Foo', we would write:
///
/// expect(bar, new isInstanceOf<Foo>());
-///
-/// To get better error message, supply a name when creating the
-/// Type wrapper; e.g.:
-///
-/// expect(bar, new isInstanceOf<Foo>('Foo'));
-///
-/// Note that this does not currently work in dart2js; it will
-/// match any type, and isNot(new isInstanceof<T>()) will always
-/// fail. This is because dart2js currently ignores template type
-/// parameters.
class isInstanceOf<T> extends Matcher {
- final String _name;
- const isInstanceOf([name = 'specified type']) : this._name = name;
+ /// The [name] parameter does nothing; it's deprecated and will be removed in
+ /// future version of [matcher].
+ const isInstanceOf([@deprecated String name]);
+
bool matches(obj, Map matchState) => obj is T;
- // The description here is lame :-(
+
Description describe(Description description) =>
- description.add('an instance of ${_name}');
+ description.add('an instance of $T');
}
/// A matcher that matches a function call against no exception.
diff --git a/lib/src/string_matchers.dart b/lib/src/string_matchers.dart
index c93963f..4643434 100644
--- a/lib/src/string_matchers.dart
+++ b/lib/src/string_matchers.dart
@@ -34,14 +34,14 @@
///
/// For example, the following will all match successfully:
///
-/// expect("hello world", equalsIgnoringCase("hello world"));
-/// expect(" hello world", equalsIgnoringCase("hello world"));
-/// expect("hello world ", equalsIgnoringCase("hello world"));
+/// expect("hello world", equalsIgnoringWhitespace("hello world"));
+/// expect(" hello world", equalsIgnoringWhitespace("hello world"));
+/// expect("hello world ", equalsIgnoringWhitespace("hello world"));
///
/// The following will not match:
///
-/// expect("helloworld", equalsIgnoringCase("hello world"));
-/// expect("he llo world", equalsIgnoringCase("hello world"));
+/// expect("helloworld", equalsIgnoringWhitespace("hello world"));
+/// expect("he llo world", equalsIgnoringWhitespace("hello world"));
Matcher equalsIgnoringWhitespace(String value) =>
new _IsEqualIgnoringWhitespace(value);
diff --git a/test/core_matchers_test.dart b/test/core_matchers_test.dart
index 5d8a194..1769ba4 100644
--- a/test/core_matchers_test.dart
+++ b/test/core_matchers_test.dart
@@ -175,9 +175,9 @@
});
test('isInstanceOf', () {
- shouldFail(0, new isInstanceOf<String>('String'),
+ shouldFail(0, new isInstanceOf<String>(),
"Expected: an instance of String Actual: <0>");
- shouldPass('cow', new isInstanceOf<String>('String'));
+ shouldPass('cow', new isInstanceOf<String>());
});
group('Predicate Matchers', () {