You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This may be a case of user error, however after setting up cedar in our iOS project and blank test projects from scratch half a dozen times I'm still here scratching my head as to why I can't get any of the matchers to work with object literals. I sent a message to the Google Group a couple weeks ago but noticed it hadn't been approved.
The issue is that if I pass in object literals like @strings or [NSNumber numberWithInt:2] to the equal or expect macros then the examples won't build. The errors usually look like this:
Semantic Issue
error: no matching function for call to 'equal' [3]
For example, here's a sample spec I set up in a blank project + cedar:
#import<Cedar-iOS/SpecHelper.h>
using namespace Cedar::Matchers;
SPEC_BEGIN(ExampleSpec)
describe(@"Example", ^{
it(@"should compare scalars", ^{
expect(1+1).to(equal(2));
});
it(@"should compare objects", ^{
// Works fineNSString* aString = @"something";
expect(aString).to(equal(aString));
// Works fineNSString* bString = @"something";
expect(aString).to(equal(bString));
// Semantic Issue// error: no matching function for call to 'equal' [3]expect(aString).to(equal(@"something"));
// Semantic Issue// error: no matching function for call to 'equal' [3]NSNumber *two = [NSNumbernumberWithInt:(1+1)];
expect([NSNumbernumberWithInt:(1+1)]).to(equal([NSNumbernumberWithInt:(2)]));
});
});
SPEC_END
I've detailed the exact setup instructions I've taken along with code and screenshots in this gist: https://gist.github.com/1691576
I've tried to get the target settings to match the Cedar iPhoneSpecs target settings, but still no joy. Any ideas?
The text was updated successfully, but these errors were encountered:
Hey Jeff. ARC and Cedar are not very friendly to each other as of now. We are slowly moving towards Cedar being compatible with ARC; however, there are couple of issues that remain unsolved. Problem you're experiencing is one of those issues. If you turn off ARC you should be able to run above spec successfully.
Thanks for the update Dmitriy. I'd been following issue #20 so when I saw that was closed I thought Cedar was fully ARC compatible now. But like you said, it seems to work fine without ARC.
This may be a case of user error, however after setting up cedar in our iOS project and blank test projects from scratch half a dozen times I'm still here scratching my head as to why I can't get any of the matchers to work with object literals. I sent a message to the Google Group a couple weeks ago but noticed it hadn't been approved.
The issue is that if I pass in object literals like
@strings
or[NSNumber numberWithInt:2]
to theequal
orexpect
macros then the examples won't build. The errors usually look like this:For example, here's a sample spec I set up in a blank project + cedar:
I've detailed the exact setup instructions I've taken along with code and screenshots in this gist: https://gist.github.com/1691576
I've tried to get the target settings to match the Cedar iPhoneSpecs target settings, but still no joy. Any ideas?
The text was updated successfully, but these errors were encountered: