Skip to content
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

Fix #41 unable to integrate test target #92

Conversation

joshuatbrown
Copy link

This fixes #41. However, due to the way we fixed it, the Tests target in RZBluetooth no longer compiles. We've tried various ways to fix the problem but haven't found a solution yet. I'm hoping that by opening this PR, we'll get some help with the Tests target.

Here's what we did:

  • created a new podspec for RZBluetoothTest that contains the files that used to be part of the RZBluetooth/Test subspec
  • changed the imports in RZBSimulatedTestCase since they now depend on the main RZBluetooth/Mock spec (and therefore need to be imported with RZBluetooth/...)

The second bullet is where the problem lies. By importing with RZBluetooth/..., we've broken the test target which does not have those files in a separate framework. But importing this way is required so that the new RZBluetoothTest podspec builds in CocoaPods.

Copy link
Contributor

@KingOfBrian KingOfBrian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @joshuatbrown. We do need to get the tests working though. I may get some time to look into it this week.

Also, it'd be great to do another pod for the Mocks if you're interested!

#import "RZBSimulatedTestCase.h"
#import "NSRunLoop+RZBWaitFor.h"
#import "RZBCentralManager+Private.h"
#import "RZBLog.h"
#import "RZBluetooth/RZBCentralManager+Private.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a while... Why do we need the private header? Ideally we wouldn't, but if we can safely remove it we should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it exposes the RZBCommandDispatch *dispatch property which is used in waitForQueueFlush and required for RZBAssertCommandCount().

Pod::Spec.new do |s|
s.name = "RZBluetoothTest"
s.version = "1.2.2"
s.summary = "A Core Bluetooth helper library to simplify the development and testing of Core Bluetooth applications."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The summary should state that this pod is specifically so simplify testing bluetooth with XCTest and RZBluetooth mocks.

@mplorentz
Copy link
Contributor

@KingOfBrian I think I made all the changes you requested. I also updated the RZBluetoothExample app to use the RZBluetoothTest podspec. Can you re-review?

@joshbrown-eg
Copy link
Contributor

This looks good — would love to get this merged.

@cpatterson-lilly
Copy link
Contributor

Does RZBluetoothMock need similar treatment to be broken out into its own podspec?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to integrate into iOS unit test target
5 participants