03 Jun 2016
Features:
captureEnabled
property to HCArgumentCaptor to control whether subsequent matched values are captured.Improvements:
Deprecated:
equalToIgnoringWhiteSpace
has been renamed to equalToCompressingWhiteSpace
.22 May 2016
Fixes:
-Wsemicolon-before-method-body
. Thanks to: Sylvain DefresneisIn
matcher in README.Features:
assertThatAfter
to use runloop observer instead of while loop comparing dates. The condition is now tested on every pump of the runloop instead of polling after a predefined delay. Thanks to: Dan FlemingDeprecated:
16 Jan 2016
Fixes:
Features:
allOf
, allOfIn
.14 Dec 2015
Features:
assertThat
does.02 Nov 2015
For detailed discussion on v5.0.0, see http://qualitycoding.org/ochamcrest-v5-0-0/
Features:
allOfIn
. The matcher hasEntriesIn
is an exception and takes an NSDictionary.Renamed:
containsInRelativeOrder
from prefix hc_ to HC_ to conform to other matchers.Deleted:
equalToBool
matcher (deprecated in v4.1.0)containsString
matcher (deprecated in v4.2.0)assertThatAfter
/futureValueOf
(deprecated in v4.2.0)HC_testFailureHandlerChain()
(deprecated in v4.2.0)31 Oct 2015
Project changes:
24 Oct 2015
Project changes:
11 Oct 2015
Features:
containsInRelativeOrder
matches collections containing items in relative order.Project changes:
11 Sep 2015
Fixes:
instanceOf
.Features:
assertWithTimeout(1, thatEventually(var), is(@10));
Deprecated:
containsString
; use containsSubstring
instead. containsString
clashes with an NSString method introduced in iOS 8.assertThatAfter
/futureValueOf
. Use assertWithTimeout
/thatEventually
instead.HC_testFailureHandlerChain()
; use [HCTestFailureReporterChain reporterChain]
instead.31 Dec 2014
30 Dec 2014
Fixes:
equalToBool
attempts to match a non-number.Features:
assertThatAfter
tests asynchronous code, retrying the assertion until a given timeout. Wrap the code you want to evaluate in futureValueOf
. Thanks to: Sergio PadrinoeveryItem
matches collections if every item satisfies a given matcher.throwsException
matches a block if it throws an exception satisfying a given matcher.isTrue
and isFalse
match non-zero and zero NSNumbers. Intended to replace equalToBool
.Improvements:
equalToBool
matcher can no longer be created with a value other than YES or NO. This especially avoids the accidental @YES.greaterThan
, etc.) so that when the given object can't be compared, the matchers return NO instead of throwing an exception.hasItem
.hasProperty
to show actual property value or “no property”.onlyContains
, especially in reporting all elements that don't match.Deprecated:
equalToBool
deprecated in favor of isTrue
and isFalse
. equalToBool(YES)
had too much potential for semantic error since any non-zero number evaluates to true.04 Jun 2014
Project changes:
10 May 2014
This is a refactoring release with potential backwards compatibility issues for writers of custom matchers:
Also, if you're not using CocoaPods, specify -ObjC
in your “Other Linker Flags”.
29 Oct 2013
Fixes:
describedAs
matcher . Thanks to: Nikolaj SchumacherhasProperty
matcher when the property is a primitive type. Thanks to: Nikolaj SchumacherImprovements:
id
so that matchers can be used without casting to (id)
for OCMockito arguments.Examples & Documentation:
06 Sep 2013
Features:
Deleted:
empty
matcher (deprecated in v2.1.0)23 Jun 2013
Fixes:
Features:
Deprecated:
empty
clashed with the C++ string method of the same name. It has been renamed to isEmpty
.Project changes:
12 May 2013
Fixes:
instanceOf
and isA
when argument was nil
.Improvements:
13 Apr 2013
This release adopts Semantic Versioning (http://semver.org). Since removal of deprecated items is a backwards incompatible change, the major version number is incremented. Thanks to: Jens Nerup
Fixes:
conformsToProtocol:
New matchers:
isA
matches objects that are instances of a given class, but not of any subclass.Improved matchers:
equalToBool
has a better description. Thanks to: Jonathan CrookeinstanceOf
mismatch description now includes actual class.Deleted following items deprecated in v1.8:
boxNumber
HC_conformsToProtocol
(which was renamed to HC_conformsTo
)Project changes:
23 Nov 2012
Improved matchers:
hasCount
/ hasCountOf
mismatch description so that count comes first (if object has a count).Project changes:
09 Jul 2012
The primary purpose of this release is to make it easier to add OCHamcrest to iOS projects. No more need to specify “Other Linker Flags”! Depending on your project, you may be able to eliminate:
-lstdc++
-ObjC
Also, the repository has a new official home: https://github.com/hamcrest/OCHamcrest/
No need to specify “Other Linker Flags” in iOS projects:
Deprecated:
boxNumber
.conformsToProtocol
clashed with the method of the same name. It has been renamed to conformsTo
.Deleted following items deprecated in v1.2:
-[HCDescription appendValue]
+[HCInvocationMatcher createInvocationForSelector:onClass:]
20 Feb 2012
New matchers:
conformsToProtocol
matches objects that conform to a given protocol. Thanks to: Todd FarrellImproved matchers:
hasProperty
now works for methods with primitive return types. Thanks to: Christopher PickslayOther improvements:
27 Sep 2011
Fixes:
stringContainsInOrder
was missing from the master header; now it's there.New matchers:
hasProperty
matches the return value of a method with a given name. (It could be a property, but really can be any method with no arguments that returns an object.) Thanks to: Justin ShackletteImprovements:
nil
at the end.29 Apr 2011
Fixes:
nil
description.Packaging:
New matcher:
stringContainsInOrder
matches string containing given list of substrings, in order.Improved matchers:
sameInstance
mismatch description to omit address when describing nil
.anyOf
and allOf
to implicitly wrap non-matcher values in equalTo
.13 Feb 2011
New matchers:
hasEntries
matches dictionary containing key-value pairs satisfying a given list of alternating keys and value matchers.Improvements:
Improved descriptions:
hasEntry
, removing colon so it doesn‘t get truncated in Xcode’s error display.is
no longer says “is ...” in its description, but just lets the inner description pass through.05 Jan 2011
Improved descriptions:
contains
and containsInAnyOrder
to describe mismatch if item is not a collection.describedAs
and is
to use their nested matchers to generate mismatch descriptions.sameInstance
is more readable, and includes object memory addresses.hasCount
mismatch describes actual count.Other improvements:
instanceOf
now guards against nil
being passed as the expected type.03 Jan 2011
Fixes:
New matchers:
hasCount
matches collections for which -count
satisfies a given matcher.hasCountOf
matches collections for which -count
equals a given count.empty
matches empty collection.Improvements:
shortMismatchDescription
determines whether mismatch description is short or long. Default is long description.-invokeOn:
invokes stored invocation on given item.nil
cannot be directly stored in collections, collection matchers now guard against nil
.-appendDescriptionOf:
to handle all types of values, not just self-describing values.Deprecated:
-appendValue:
no longer needed; call -appendDescriptionOf:
instead. This also means NSObject+SelfDescribingValue is no longer needed.+createInvocationForSelector:onClass:
to +invocationForSelector:onClass:
HCRequireNonNilObject
should be used in place of HCRequireNonNilString
.28 Dec 2010
Fixes:
allOf
, anyOf
and isIn
on iOS. Related to -ObjC
linker flag.New matchers:
contains
matches collections with matching items in order.containsInAnyOrder
matches collections with matching items in any order.Improvements:
make install
from the Documentation folder to install.id
, to support possibility of subclassing matchers.26 Oct 2010
First official release, including:
07 Oct 2010
#import <OCHamcrestIOS/OCHamcrestIOS.h>
Thanks to: Aaron Jacobs06 Oct 2010
06 Sep 2010
01 Dec 2009
assertThat___
and equalTo___
for all types understood by NSNumber. For example:assertThatInt(42, equalToInt(42))
24 Nov 2009
assertThat
behavior to work more seamlessly with OCUnit: Instead of throwing an exception, it calls the same method as OCUnit‘s assertion macros to fail the test. As a result, a failing assertThat
will not terminate the test, so that the test can record other failures. (Following normal OCUnit behavior, you can instruct the test case to terminate at the first failure by invoking raiseAfterFailure
.)assertThat
be called only within subclasses of SenTestCase, which wasn’t the case before. You will need to recompile your tests.24 Nov 2009
assertThat
description.17 Oct 2009
11 Aug 2009
07 Jul 2009
28 Jan 2009
24 Jan 2009
matches:describingMismatchTo:
to do it one shot, or call describeMismatchOf:To:
once you know a particular item does not match.18 Jul 2008
13 Apr 2008