specta / expecta

A Matcher Framework for Objective-C/Cocoa
MIT License
1.59k stars 158 forks source link

If test fails, notify if comparing two different types/classes #167

Closed jorystiefel closed 9 years ago

jorystiefel commented 9 years ago

if expect().is.equal(...) fails, perhaps mention if the objects/values being compared are of different types.

For example, I had a failure below, which seems like it should work, both URLs are the same. I eventually realized I was comparing an NSURL to an NSString.

NSString *webpageURL = @"http...";
expect(activity.webpageURL).to.equal(webpageURL);

Failure output:

Artsy[98241:12747862] /ARUserActivityTests.m:35 expected: https://m.artsy.net/artwork/artwork_id, got: https://m.artsy.net/artwork/artwork_id