-
-
Notifications
You must be signed in to change notification settings - Fork 607
Add public accessors for types to begin supporting XCode 6 beta 4. #8
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
Conversation
@@ -21,12 +21,12 @@ func beginWith(startingSubstring: String) -> MatcherFunc<String> { | |||
failureMessage.postfixMessage = "begin with <\(startingSubstring)>" | |||
let actual = actualExpression.evaluate() | |||
let range = actual.rangeOfString(startingSubstring) | |||
return range.startIndex == actual.startIndex | |||
return range?.startIndex == actual.startIndex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return range && range!.startIndex == actual.startIndex
Hey @blindsey, bridging headers don't seem supported for frameworks anymore, but due to the way Swift classes are generated -- they aren't normal Objective-C classes, you cannot forward declare them without the proper swift attributes. This might be a bug to file to Apple, but more investigation is required first. I'm currently limited in time right now, but I'll try to check it out this weekend. |
@jeffh I'm struggling with getting the tests to run after removing Nimble-Bridging-Header.h. The 'expect' func isn't exported anymore. Curious to see what your investigation turns up. |
remove:
make NMBExpectation and init method public:
then it will compile 👍 |
@blindsey thanks - got the conditional checks around range corrected. @sync got NMBExpectation working. I could've sworn I tried that, but clearly I didn't and I'm still trying to learn how Swift and ObjC work together. 👍 The next steps I believe are to get the tests passing, which is what @blindsey was referring to I believe. |
Good catch - corrected. Right now, I'm dealing with BasicMatcher not conforming to Matcher protocols. I'm not sure if I messed up something while adding public accessors to get things to compile or if it's a compilation difference between beta 3 and beta 4. |
Made it quite a bit farther now... I'll try to summarize what's happened and ask for some eyes/feedback on what I've done, because I may have taken some missteps.
If I exit out of Let me know if I'm way off base or anything with these changes! Thanks! |
@drmohundro as for I guess this is a normal behaviour, because Swift Array is not Equatable. There are several ways to bypass this restriction:
expect(arrayOne == arrayTwo).to(beTrue())
func equal<T: Equatable>(expectedValue: [T]?) We are facing the same problem in our similar framework and we've decided to use NSArrays instead of Arrays by now. |
@drmohundro I cloned your branch and tried out a few things. I got stuff mostly working by adding these things:
Finally, on line 40 of BeEmptyTest.swift replace "<(1)>" with "<[1]>" There are still 3 (2 really) tests that fail. The async wrapper and the identical to message test. |
Also, there was a typo in |
OK ... figured out the Async issue: In
|
That only leaves issues with the error messages. It seems the actual Nimble lib works for beta 4. |
ugh ... ok that seemed silly .. I got everything passing ... I'll PR into here and to @drmohundro's fork. Not sure how you want to handle getting all this in. |
Fix for beta 4 compatibility
Great work everyone! I've been getting some weird test crash when the exercising @drmohundro, could you try running |
Interesting... I am getting failures while running |
@drmohundro, I think it might be related to the simulator variant. I'm tempted to write this one up as a swift compiler bug. |
Interesting... you're right, I can repro it within XCode by using iPhone 4S simulator as an example. Here's a screenshot if anyone has any good ideas. I was going to say it might have something to do with the Expression instance getting cleaned up, but as far as I can tell, everything is a struct at this level of the call stack (so no deinit). |
I've merged #10, which includes these changes too. I'll open new issues for this problem (it might be filed to apple). Also, I prefer to not have operator overrides and have them specified in the matchers instead. |
Add NMBDoubleConvertible conformance to CGFloat on Linux
Add NMBDoubleConvertible conformance to CGFloat on Linux
Update SwiftPM and Linux support
This is the first step in getting Nimble ready for XCode 6 beta 4.
The following things are included in this:
NMBExpectation
(was getting an error related to it)I'm still getting an error related to:
But I'm unfamiliar with what the problem is here.
I thought this might help in terms of getting a start, though. I'll continue to try to resolve the "undefined symbols" error as well.