-
Notifications
You must be signed in to change notification settings - Fork 268
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
Swift TyphoonBlockComponentFactory Error in XCTest #242
Comments
Thanks for reporting. . we'll investigate. Out of interest, what happens when you edit the file resolved by CocoaPods and remove that line? (Its only there safety purposes against incorrect code). Does everything otherwise proceed normally? Would you care to email a sample project to: [email protected] ? |
Hi @RobbieBubble , thanks for reporting.. I had same problem in objective-c, when using cocoapods and test target. The test target was set using test host, i.e. attaching to running application of main target. NSLog(@"Assembly base class: %p", [TyphoonAssembly class]); I had different addresses in test and main target at same. It is very serious problem. To fix, try to remove Typhoon from your test target, then run pod install/update and clean all derived data/build clean and try test agian |
@alexgarbarev Nice investigation. @RobbieBubble In my experience when removing dependencies from test target, certain situations can leave stale files. To be safe, what I do is:
Instead of running |
@alexgarbarev The Podfile has to look like
instead of
@jasperblues Actually i had this in mind that the inclusion of Typhoon in the Test-Configuration might cause problems but i've never removed it because i thought i need it so that i can use the Typhoon-classes in my testcase. Thx for your support and sorry for bothering the Typhoon Group with "non Typhoon related" problems |
@RobbieBubble Not at all, thanks for reporting the issue, we always appreciate feedback, and we're very happy to here about your progress with Typhoon and Swift. |
ps: For the old-style logic tests it was necessary to include the dependencies in both targets. But as @alexgarbarev mentions, we have TEST_HOST set, or in other words Application-style tests, then the tests will inherit all dependencies from the main target. Application-style tests are the default almost everywhere now. We can still add some further dependencies (eg matching libs, etc) explicitly to just the test target using eg: target :tests, :exclusive => true do
pod 'OCMockito'
end |
XCode: 6-Beta5
Typhoon: 2.1.0
i’m using Swift with Typhoon and Cocoapods. Everything worked well until i started to write an Integrationtest (according to the Typhoon-Example-App Test) for my Typhoon component. I wanted to setup the
TyphoonFactory
in the TestsetUp()
method in the same way as i did in theAppDelegate
. When i execute the test i always get aTyphoonBlockComponentFactory assertIsAssembly:] + 244: ERROR: MyApp.MyAssembly is not a sub-class of TyphoonAssembly
error thrown by Typhoon (wich is using the
kindOfClass
method under the hood.) The same code is working perfectly in theAppDelegate
and i can’t figure out whats wrong.To verify this behavior i implemented the
isKindOfClass
check in booth classes (see code below):PodFile
MyAssembly.swift
AppDelegate.swift
MyComponentTest.swift
The text was updated successfully, but these errors were encountered: