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

Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions RZBluetooth.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
Pod::Spec.new do |s|
s.name = "RZBluetooth"
s.version = "1.2.1"
s.version = "1.2.2"
s.summary = "A Core Bluetooth helper library to simplify the development and testing of Core Bluetooth applications."

s.description = <<-DESC
Expand Down Expand Up @@ -35,12 +35,4 @@ RZBluetooth is a Core Bluetooth helper with 3 primary goals:
mock.private_header_files = "RZMockBluetooth/**/*+Private.h"
end

s.subspec "Test" do |test|
test.dependency "RZBluetooth/Mock"
test.frameworks = "XCTest"
test.source_files = "RZBluetoothTests/RZBTestDefines.h",
"RZBluetoothTests/RZBSimulatedTestCase.{h,m}",
"RZBluetoothTests/Helpers/NSRunLoop+RZBWaitFor.{h,m}"
test.public_header_files = "RZBluetoothTests/RZBSimulatedTestCase.h", "RZBluetoothTests/RZBTestDefines.h"
end
end
2 changes: 2 additions & 0 deletions RZBluetooth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
0F659177213734F100A3122A /* RZBluetoothTest.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = RZBluetoothTest.podspec; sourceTree = "<group>"; };
15930BDA1D1C2032009C269C /* libRZBluetooth-OSX.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libRZBluetooth-OSX.a"; sourceTree = BUILT_PRODUCTS_DIR; };
AB056E461CBBD55E00145E87 /* RZBSimulationObjectTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RZBSimulationObjectTests.m; sourceTree = "<group>"; };
AB0E299B1B7E19E100A1ADA9 /* RZBPeripheral+RZBHeartRate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "RZBPeripheral+RZBHeartRate.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -296,6 +297,7 @@
children = (
AB45C5481B6C0B8900CC0166 /* README.md */,
ABCD83AB1B7ACD5900DA1162 /* RZBluetooth.podspec */,
0F659177213734F100A3122A /* RZBluetoothTest.podspec */,
AB45C49B1B6BF70B00CC0166 /* RZBluetooth */,
AB45C4E51B6BF8BA00CC0166 /* RZMockBluetooth */,
AB45C4A81B6BF70B00CC0166 /* RZBluetoothTests */,
Expand Down
30 changes: 30 additions & 0 deletions RZBluetoothTest.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
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.


s.description = <<-DESC
RZBluetooth is a Core Bluetooth helper with 3 primary goals:

- Simplify the delegate callbacks and encourage best practices
- Provide a pattern for Profile level APIs, with support for public profiles
- Simplify and encourage testing - including unit tests, automated integration tests, and manual tests.
DESC

s.homepage = "http://github.com/Raizlabs/RZBluetooth"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Brian King" => "[email protected]" }
s.osx.deployment_target = "10.10"
s.ios.deployment_target = "8.0"
s.source = { :git => "https://github.com/Raizlabs/RZBluetooth.git", :tag => s.version }
s.requires_arc = true

s.dependency "RZBluetooth/Mock"
s.frameworks = "XCTest"
s.source_files = "RZBluetoothTests/RZBTestDefines.h",
"RZBluetoothTests/RZBSimulatedTestCase.{h,m}",
"RZBluetoothTests/Helpers/NSRunLoop+RZBWaitFor.{h,m}"
s.public_header_files = "RZBluetoothTests/RZBSimulatedTestCase.h", "RZBluetoothTests/RZBTestDefines.h"

end
20 changes: 10 additions & 10 deletions RZBluetoothTests/RZBSimulatedTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@

@import XCTest;

#import "RZBCentralManager.h"
#import "RZBPeripheral.h"
#import "RZBScanInfo.h"
#import "RZBluetooth/RZBCentralManager.h"
#import "RZBluetooth/RZBPeripheral.h"
#import "RZBluetooth/RZBScanInfo.h"

#import "RZBMockCentralManager.h"
#import "RZBMockPeripheralManager.h"
#import "RZBluetooth/RZBMockCentralManager.h"
#import "RZBluetooth/RZBMockPeripheralManager.h"

#import "RZBSimulatedDevice.h"
#import "RZBSimulatedCentral.h"
#import "RZBSimulatedConnection.h"
#import "RZBSimulatedCallback.h"
#import "RZBluetooth/RZBSimulatedDevice.h"
#import "RZBluetooth/RZBSimulatedCentral.h"
#import "RZBluetooth/RZBSimulatedConnection.h"
#import "RZBluetooth/RZBSimulatedCallback.h"

#import "NSError+RZBMock.h"
#import "RZBluetooth/NSError+RZBMock.h"

/**
* The RZBSimulatedTestCase is a convience class to assist testing bluetooth code.
Expand Down
6 changes: 3 additions & 3 deletions RZBluetoothTests/RZBSimulatedTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
//

#import "RZBTestDefines.h"
#import "RZMockBluetooth.h"
#import "RZBluetooth/RZMockBluetooth.h"
#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().

#import "RZBluetooth/RZBLog.h"

@implementation RZBSimulatedTestCase

Expand Down