If you want to enforce that a value is an actual string, use stringValue().
When you have an object you probably want to test the result of __toString()
without having to cast it yourself. This should be automatic.
The problem is that you get bogus failure messages saying that two equal
strings are not equal because _isSafeType() returns false but
describeMismatch() doesn't take that into account.
It looks like the fix could be applied to _isSafeType() by returning true for
objects when the desired type is string, perhaps only when they have a
__toString() method.
Original issue reported on code.google.com by dharkn...@gmail.com on 27 Sep 2011 at 7:38
Original issue reported on code.google.com by
dharkn...@gmail.com
on 27 Sep 2011 at 7:38