New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Many modifications #12
Conversation
When expecting an asynchronous negative, if the matchBlock returns true, we will return a fail before waiting the timeout. I modified the asynchronous tests to fail with that bug and fixed the bug by taking into account the negative in the asynchronous loop.
Hey I am sorry. I don't know how I missed this. Changes look good, but is this backwards-compatible? |
If it isn't I might have to increment major version number and add some more features :P |
Unfortunately not. As I took the liberty of changing the naming convention heavily, I thought it was best not to leave two conventions in parallel. What do you think?
I'm also planning on adding a By the way, I spent a while trying to implement exception matching like so: expect([object methodCall]).to.raise();
expect([object methodCall:nil]).to.raiseException(@"NSInvalidArgumentException"); But I got stuck for several reasons. First of all, the expect(^{ [object methodCall] }).to.raise();
expect(^{ [object methodCall:nil] }).to.raiseException(@"NSInvalidArgumentException"); But I got another problem implementing the asynchronous matching:
Indeed, I wrapped the calls to the run loop in a try/catch block, but it seems that exceptions that happened did not get caught by that try/catch block. Any ideas? |
Improved the naming convention
Not
becomestoNot
to
is a new no-opisGoing
becomeswill
isNotGoing
becomeswillNot
Changed the
contain
matcher to work with any NSFastEnumeration classNow, the
contain
matcher works with NSString and any class that conforms to the NSFastEnumeration protocol. Therefore, it works with NSSet, and with NSDictionary. Currently, it will only match key-value pairs with NSDictionary. Perhaps we need haveKey/haveValue matchers specifically for NSDictionary.Fix ARC error with the
beIdenticalTo
matcherWith projects using ARC, the
beIdenticalTo
matcher caused an error if the expected value is of typeid
, as ARC does not allow implicitly casting fromid
tovoid*
. I added abeIdenticalTo
macro that explicitly does a bridge cast.Fixed a false negative bug with negative asynchronous
When expecting an asynchronous negative, if the matchBlock returns true, we will return a fail before waiting the timeout. I modified the asynchronous tests to fail with that bug and fixed the bug by taking into account the negative in the asynchronous loop.