From df59e5d4ffcd1aa75ffd3e1d2a136f7b7af796b3 Mon Sep 17 00:00:00 2001 From: Luke Redpath Date: Thu, 2 Jun 2016 14:29:27 +0100 Subject: [PATCH 1/2] Make it clear that identity matchers only work with reference types This might be obvious to an experienced Swift developer but it could catch people out (like me - see #298). --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 71d523b5c..6e14cd7c3 100644 --- a/README.md +++ b/README.md @@ -492,6 +492,9 @@ expect(actual).toNot(beIdenticalTo(expected)) expect(actual) !== expected ``` +Its important to remember that beIdenticalTo only makes sense when comparing types with reference semantics, which have a notion of identity. In Swift, that means a `class`. This matcher will not work with types with value semantics such as `struct` or `enum`. If you need to compare two value types, you can either compare individual properties or if it makes sense to do so, make your type implement `Equatable` and use Nimble's equivalence matchers instead. + + ```objc // Objective-C From 48215ab709acf028837f7c801c22a9d82946eb60 Mon Sep 17 00:00:00 2001 From: Luke Redpath Date: Thu, 2 Jun 2016 14:33:01 +0100 Subject: [PATCH 2/2] Syntax highlight function name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6e14cd7c3..6a71957d3 100644 --- a/README.md +++ b/README.md @@ -492,7 +492,7 @@ expect(actual).toNot(beIdenticalTo(expected)) expect(actual) !== expected ``` -Its important to remember that beIdenticalTo only makes sense when comparing types with reference semantics, which have a notion of identity. In Swift, that means a `class`. This matcher will not work with types with value semantics such as `struct` or `enum`. If you need to compare two value types, you can either compare individual properties or if it makes sense to do so, make your type implement `Equatable` and use Nimble's equivalence matchers instead. +Its important to remember that `beIdenticalTo` only makes sense when comparing types with reference semantics, which have a notion of identity. In Swift, that means a `class`. This matcher will not work with types with value semantics such as `struct` or `enum`. If you need to compare two value types, you can either compare individual properties or if it makes sense to do so, make your type implement `Equatable` and use Nimble's equivalence matchers instead. ```objc