Did you accidentally add the class to your specs target also?

31 views
Skip to first unread message

Jeff Kunzelman

unread,
Feb 8, 2016, 10:46:22 PM2/8/16
to Cedar Discussion

I seem to be getting this fail every time I try to use be_instance_of 


I'm using cedar with Xcode 7.


FAILURE GIMainViewController after instantiating from a storyboard should create a GISettingsViewController

/Users/jeff/workspace/gpsi-standard-ios/GPSi-Standard-iOSTests/GIMainViewControllerSpec.mm:42 Expected <<GISettingsViewController: 0x7ff24e704e50> (GISettingsViewController)> to be an instance of class <GISettingsViewController>. Did you accidentally add the class to your specs target also?FAILURE


 I might not be understanding what needs to get added to the test bundle. I'm also seeing messages like:


GMSx_ClientanalyticsRoot is implemented in both /Users/jeff/Library/Developer/CoreSimulator/Devices/9AB6494E-2D06-4303-A576-B7D77D065D75/data/Containers/Bundle/Application/939B32B9-275C-4072-9DEC-5666D971A9E7/GPSi-Standard-iOS.app/GPSi-Standard-iOS and /Users/jeff/Library/Developer/Xcode/DerivedData/GPSi-Standard-iOS-amzysslgfmrbasbwhzqxiistiuvn/Build/Intermediates/CodeCoverage/Specs/Products/Debug-iphonesimulator/GPSi-Standard-iOSTests.xctest/GPSi-Standard-iOSTests. One of the two will be used. Which one is undefined.




Andrew Kitchen

unread,
Feb 8, 2016, 11:11:20 PM2/8/16
to cedar-...@googlegroups.com
Hi Jeff,

It seems that this target contains duplicate occurrences of these classes - it could be due to a merge mistake in the project file, or could have crept in another way.

If you are using a test bundle, classes from your app should not need to be contained by the bundle as they already exist when the bundle is loaded along with the app. Same goes for linking, I believe.

Also, that error message could use a little improvement. Free bonus internet points to anyone willing to suggest edits and fix the spacing in a pr

Thanks!
Andrew
--
You received this message because you are subscribed to the Google Groups "Cedar Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cedar-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeff Kunzelman

unread,
Feb 11, 2016, 2:34:27 PM2/11/16
to Cedar Discussion
I did remove the extra imports as you suggested. And that seem to resolve some of the error messages I mentioned.

I'm wondering if I started my project correctly in Xcode 7.2. When creating I left the 2 targets Xcode creates for XCTest unit and ui. I then created all my specs under the test target. I seem to remember when working on a pivotal project that this looked a little different, but maybe cause i'm not using Xcode 7 not 6. 

I created this project as a starting point for testing with cedar. 

This is how I set up my current project. Could you take a look and see if it's done correctly? I'm also installing via cocoapods and adding the same pods to both the app target and the test targets. I believe this is causing similar issues importing classes multiple times.

Andrew Kitchen

unread,
Feb 11, 2016, 2:38:42 PM2/11/16
to cedar-...@googlegroups.com
Hey Jeff,

I wasn't referring to imports, although glad to hear that it helped with some of the issues. I was more concerned about linking and loading classes potentially more than once, which is how I interpreted your error messages.

Thanks for the repo - there's nothing quite like working software (or non-working software) to inform the discussion. I or someone else will have a look soon

Andrew
Reply all
Reply to author
Forward
0 new messages