diff --git a/ConnectSDKIntegrationTests/ConnectSDKIntegrationTests-Prefix.pch b/ConnectSDKIntegrationTests/ConnectSDKIntegrationTests-Prefix.pch new file mode 100644 index 0000000..f1f2884 --- /dev/null +++ b/ConnectSDKIntegrationTests/ConnectSDKIntegrationTests-Prefix.pch @@ -0,0 +1,32 @@ +// +// ConnectSDKIntegrationTests-Prefix.pch +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/26/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#ifndef ConnectSDK_ConnectSDKIntegrationTests_Prefix_pch +#define ConnectSDK_ConnectSDKIntegrationTests_Prefix_pch + +// Include any system framework and library headers here that should be included in all compilation units. +// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. + +#import "ConnectSDKTests-Prefix.pch" + +#import +#import + +#endif diff --git a/ConnectSDKIntegrationTests/DLNAServiceIntegrationTests.m b/ConnectSDKIntegrationTests/DLNAServiceIntegrationTests.m new file mode 100644 index 0000000..4500ce0 --- /dev/null +++ b/ConnectSDKIntegrationTests/DLNAServiceIntegrationTests.m @@ -0,0 +1,79 @@ +// +// DLNAServiceIntegrationTests.m +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/26/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "DiscoveryManager.h" +#import "DLNAService.h" +#import "SSDPDiscoveryProvider.h" + +#import "EXPMatchers+matchRegex.h" + +#pragma mark - Environment-specific constants + +static NSString *const kExpectedDeviceName = @"Living Room - Sonos PLAY:1 Media Renderer"; +static NSString *const kExpectedIPAddressRegex = @"192\\.168\\.1\\.\\d{1,3}"; + +#pragma mark - + +SpecBegin(DLNAService) + +describe(@"ConnectSDK", ^{ + it(@"should discover Sonos device in the network", ^{ + // the official way to access DiscoveryManager is through the singleton, + // but that's no good for tests + DiscoveryManager *manager = [DiscoveryManager new]; + // don't need to save any state information + manager.deviceStore = nil; + + // use a custom delegate to avoid showing any UI and get the discovery + // callbacks + id delegateStub = OCMProtocolMock(@protocol(DiscoveryManagerDelegate)); + manager.delegate = delegateStub; + + // use DLNA service only + [manager registerDeviceService:[DLNAService class] + withDiscovery:[SSDPDiscoveryProvider class]]; + + // wait for a matching device + waitUntil(^(DoneCallback done) { + void (^deviceVerifier)(ConnectableDevice *) = ^void(ConnectableDevice *device) { + expect(device.address).matchRegex(kExpectedIPAddressRegex); + expect(device.id).notTo.beNil(); + expect([device serviceWithName:kConnectSDKDLNAServiceId]).notTo.beNil(); + }; + + OCMStub([delegateStub discoveryManager:manager + didFindDevice: + [OCMArg checkWithBlock:^BOOL(ConnectableDevice *device) { + if ([kExpectedDeviceName isEqualToString:device.friendlyName]) { + deviceVerifier(device); + done(); + } + + return YES; + }]]); + + [manager startDiscovery]; + }); + + [manager stopDiscovery]; + }); +}); + +SpecEnd diff --git a/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.h b/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.h new file mode 100644 index 0000000..e6c6340 --- /dev/null +++ b/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.h @@ -0,0 +1,24 @@ +// +// EXPMatchers+matchRegex.h +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/26/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import + +/// Expects a string to fully match the given @c regex. +EXPMatcherInterface(matchRegex, (NSString *regex)); diff --git a/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.m b/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.m new file mode 100644 index 0000000..096ad44 --- /dev/null +++ b/ConnectSDKIntegrationTests/EXPMatchers+matchRegex.m @@ -0,0 +1,42 @@ +// +// EXPMatchers+matchRegex.m +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/26/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "EXPMatchers+matchRegex.h" + +EXPMatcherImplementationBegin(matchRegex, (NSString *expected)) { + match(^BOOL { + NSString *string = actual; + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:expected + options:0 + error:nil]; + NSRange wholeRange = NSMakeRange(0, string.length); + NSRange matchedRange = [regex rangeOfFirstMatchInString:string + options:NSMatchingAnchored + range:wholeRange]; + return NSEqualRanges(matchedRange, wholeRange); + }); + + failureMessageForTo(^NSString * { + return [NSString stringWithFormat: + @"expected: a string matching regex %@, got: %@", + expected, actual]; + }); +} +EXPMatcherImplementationEnd diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Expecta b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Expecta new file mode 120000 index 0000000..caa14ed --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Expecta @@ -0,0 +1 @@ +Versions/Current/Expecta \ No newline at end of file diff --git a/Frameworks/OCMock/OCMock.framework/Headers b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Headers similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Headers rename to ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Headers diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/LICENSE b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/LICENSE new file mode 120000 index 0000000..7da29fc --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/LICENSE @@ -0,0 +1 @@ +Versions/Current/LICENSE \ No newline at end of file diff --git a/Frameworks/OCMock/OCMock.framework/Resources b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Resources similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Resources rename to ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Resources diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Expecta b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Expecta new file mode 100644 index 0000000..c47f5e4 Binary files /dev/null and b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Expecta differ diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPBlockDefinedMatcher.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPBlockDefinedMatcher.h new file mode 100644 index 0000000..58b1282 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPBlockDefinedMatcher.h @@ -0,0 +1,25 @@ +// +// EXPRuntimeMatcher.h +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#import +#import "EXPMatcher.h" +#import "EXPDefines.h" + +@interface EXPBlockDefinedMatcher : NSObject { + EXPBoolBlock prerequisiteBlock; + EXPBoolBlock matchBlock; + EXPStringBlock failureMessageForToBlock; + EXPStringBlock failureMessageForNotToBlock; +} + +@property(nonatomic, copy) EXPBoolBlock prerequisiteBlock; +@property(nonatomic, copy) EXPBoolBlock matchBlock; +@property(nonatomic, copy) EXPStringBlock failureMessageForToBlock; +@property(nonatomic, copy) EXPStringBlock failureMessageForNotToBlock; + +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPDefines.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPDefines.h new file mode 100644 index 0000000..52af721 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPDefines.h @@ -0,0 +1,17 @@ +// +// EXPDefines.h +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#ifndef Expecta_EXPDefines_h +#define Expecta_EXPDefines_h + +typedef void (^EXPBasicBlock)(); +typedef id (^EXPIdBlock)(); +typedef BOOL (^EXPBoolBlock)(); +typedef NSString *(^EXPStringBlock)(); + +#endif diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPExpect.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPExpect.h new file mode 100644 index 0000000..985c120 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPExpect.h @@ -0,0 +1,45 @@ +#import +#import "EXPMatcher.h" +#import "EXPDefines.h" + +@interface EXPExpect : NSObject { + EXPIdBlock _actualBlock; + id _testCase; + int _lineNumber; + char *_fileName; + BOOL _negative; + BOOL _asynchronous; + NSTimeInterval _timeout; +} + +@property(nonatomic, copy) EXPIdBlock actualBlock; +@property(nonatomic, readonly) id actual; +@property(nonatomic, assign) id testCase; +@property(nonatomic) int lineNumber; +@property(nonatomic) const char *fileName; +@property(nonatomic) BOOL negative; +@property(nonatomic) BOOL asynchronous; +@property(nonatomic) NSTimeInterval timeout; + +@property(nonatomic, readonly) EXPExpect *to; +@property(nonatomic, readonly) EXPExpect *toNot; +@property(nonatomic, readonly) EXPExpect *notTo; +@property(nonatomic, readonly) EXPExpect *will; +@property(nonatomic, readonly) EXPExpect *willNot; +@property(nonatomic, readonly) EXPExpect *(^after)(NSTimeInterval timeInterval); + +- (instancetype)initWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName NS_DESIGNATED_INITIALIZER; ++ (EXPExpect *)expectWithActualBlock:(id)actualBlock testCase:(id)testCase lineNumber:(int)lineNumber fileName:(const char *)fileName; + +- (void)applyMatcher:(id)matcher; +- (void)applyMatcher:(id)matcher to:(NSObject **)actual; + +@end + +@interface EXPDynamicPredicateMatcher : NSObject { + EXPExpect *_expectation; + SEL _selector; +} +- (instancetype)initWithExpectation:(EXPExpect *)expectation selector:(SEL)selector NS_DESIGNATED_INITIALIZER; +@property (nonatomic, readonly, copy) void (^dispatch)(void); +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatcher.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatcher.h new file mode 100644 index 0000000..b207a84 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatcher.h @@ -0,0 +1,20 @@ +// +// EXPMatcher.h +// Expecta +// +// Created by Luke Redpath on 26/03/2012. +// Copyright (c) 2012 Peter Jihoon Kim. All rights reserved. +// + +#import + +@protocol EXPMatcher + +- (BOOL)matches:(id)actual; + +@optional +- (BOOL)meetsPrerequesiteFor:(id)actual; +- (NSString *)failureMessageForTo:(id)actual; +- (NSString *)failureMessageForNotTo:(id)actual; + +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beCloseTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beCloseTo.h new file mode 100644 index 0000000..f683d6b --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beCloseTo.h @@ -0,0 +1,7 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beCloseToWithin, (id expected, id within)); +EXPMatcherInterface(beCloseToWithin, (id expected, id within)); + +#define beCloseTo(expected) _beCloseToWithin(EXPObjectify((expected)), nil) +#define beCloseToWithin(expected, range) _beCloseToWithin(EXPObjectify((expected)), EXPObjectify((range))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beFalsy.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beFalsy.h new file mode 100644 index 0000000..89c8e00 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beFalsy.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(beFalsy, (void)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThan.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThan.h new file mode 100644 index 0000000..a2f9fba --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThan.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beGreaterThan, (id expected)); +EXPMatcherInterface(beGreaterThan, (id expected)); + +#define beGreaterThan(expected) _beGreaterThan(EXPObjectify((expected))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThanOrEqualTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThanOrEqualTo.h new file mode 100644 index 0000000..3e91c64 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beGreaterThanOrEqualTo.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beGreaterThanOrEqualTo, (id expected)); +EXPMatcherInterface(beGreaterThanOrEqualTo, (id expected)); + +#define beGreaterThanOrEqualTo(expected) _beGreaterThanOrEqualTo(EXPObjectify((expected))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beIdenticalTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beIdenticalTo.h new file mode 100644 index 0000000..d13619f --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beIdenticalTo.h @@ -0,0 +1,10 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beIdenticalTo, (void *expected)); +EXPMatcherInterface(beIdenticalTo, (void *expected)); // to aid code completion + +#if __has_feature(objc_arc) +#define beIdenticalTo(expected) _beIdenticalTo((__bridge void*)expected) +#else +#define beIdenticalTo(expected) _beIdenticalTo(expected) +#endif diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInTheRangeOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInTheRangeOf.h new file mode 100644 index 0000000..8ea990e --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInTheRangeOf.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); +EXPMatcherInterface(beInTheRangeOf, (id expectedLowerBound, id expectedUpperBound)); + +#define beInTheRangeOf(expectedLowerBound, expectedUpperBound) _beInTheRangeOf(EXPObjectify((expectedLowerBound)), EXPObjectify((expectedUpperBound))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInstanceOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInstanceOf.h new file mode 100644 index 0000000..a8e8175 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beInstanceOf.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(beInstanceOf, (Class expected)); +EXPMatcherInterface(beAnInstanceOf, (Class expected)); +EXPMatcherInterface(beMemberOf, (Class expected)); +EXPMatcherInterface(beAMemberOf, (Class expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beKindOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beKindOf.h new file mode 100644 index 0000000..b8623e0 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beKindOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beKindOf, (Class expected)); +EXPMatcherInterface(beAKindOf, (Class expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThan.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThan.h new file mode 100644 index 0000000..5ed0a24 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThan.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beLessThan, (id expected)); +EXPMatcherInterface(beLessThan, (id expected)); + +#define beLessThan(expected) _beLessThan(EXPObjectify((expected))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThanOrEqualTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThanOrEqualTo.h new file mode 100644 index 0000000..2c31341 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beLessThanOrEqualTo.h @@ -0,0 +1,6 @@ +#import "Expecta.h" + +EXPMatcherInterface(_beLessThanOrEqualTo, (id expected)); +EXPMatcherInterface(beLessThanOrEqualTo, (id expected)); + +#define beLessThanOrEqualTo(expected) _beLessThanOrEqualTo(EXPObjectify((expected))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beNil.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beNil.h new file mode 100644 index 0000000..6d78162 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beNil.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beNil, (void)); +EXPMatcherInterface(beNull, (void)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSubclassOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSubclassOf.h new file mode 100644 index 0000000..65401c5 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSubclassOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beSubclassOf, (Class expected)); +EXPMatcherInterface(beASubclassOf, (Class expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSupersetOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSupersetOf.h new file mode 100644 index 0000000..f9a47ba --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beSupersetOf.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beSupersetOf, (id subset)); + diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beTruthy.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beTruthy.h new file mode 100644 index 0000000..1e4e78f --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beTruthy.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(beTruthy, (void)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beginWith.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beginWith.h new file mode 100644 index 0000000..07ddd6c --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+beginWith.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(beginWith, (id expected)); +EXPMatcherInterface(startWith, (id expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+conformTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+conformTo.h new file mode 100644 index 0000000..efc7b98 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+conformTo.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(conformTo, (Protocol *expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+contain.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+contain.h new file mode 100644 index 0000000..5803146 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+contain.h @@ -0,0 +1,5 @@ +#import "Expecta.h" + +EXPMatcherInterface(_contain, (id expected)); +EXPMatcherInterface(contain, (id expected)); // to aid code completion +#define contain(expected) _contain(EXPObjectify((expected))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+endWith.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+endWith.h new file mode 100644 index 0000000..228cea9 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+endWith.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(endWith, (id expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+equal.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+equal.h new file mode 100644 index 0000000..b4047c0 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+equal.h @@ -0,0 +1,5 @@ +#import "Expecta.h" + +EXPMatcherInterface(_equal, (id expected)); +EXPMatcherInterface(equal, (id expected)); // to aid code completion +#define equal(...) _equal(EXPObjectify((__VA_ARGS__))) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+haveCountOf.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+haveCountOf.h new file mode 100644 index 0000000..2e9aef5 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+haveCountOf.h @@ -0,0 +1,10 @@ +#import "Expecta.h" + +EXPMatcherInterface(haveCountOf, (NSUInteger expected)); +EXPMatcherInterface(haveCount, (NSUInteger expected)); +EXPMatcherInterface(haveACountOf, (NSUInteger expected)); +EXPMatcherInterface(haveLength, (NSUInteger expected)); +EXPMatcherInterface(haveLengthOf, (NSUInteger expected)); +EXPMatcherInterface(haveALengthOf, (NSUInteger expected)); + +#define beEmpty() haveCountOf(0) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+match.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+match.h new file mode 100644 index 0000000..4f0e8e4 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+match.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(match, (NSString *expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+postNotification.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+postNotification.h new file mode 100644 index 0000000..cdba4a3 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+postNotification.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(postNotification, (id expectedNotification)); +EXPMatcherInterface(notify, (id expectedNotification)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raise.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raise.h new file mode 100644 index 0000000..1f7fae0 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raise.h @@ -0,0 +1,4 @@ +#import "Expecta.h" + +EXPMatcherInterface(raise, (NSString *expectedExceptionName)); +#define raiseAny() raise(nil) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raiseWithReason.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raiseWithReason.h new file mode 100644 index 0000000..2cf5a5d --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+raiseWithReason.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(raiseWithReason, (NSString *expectedExceptionName, NSString *expectedReason)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+respondTo.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+respondTo.h new file mode 100644 index 0000000..279131d --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers+respondTo.h @@ -0,0 +1,3 @@ +#import "Expecta.h" + +EXPMatcherInterface(respondTo, (SEL expected)); diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers.h new file mode 100644 index 0000000..ed6ef85 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/EXPMatchers.h @@ -0,0 +1,25 @@ +#import "EXPMatchers+beNil.h" +#import "EXPMatchers+equal.h" +#import "EXPMatchers+beInstanceOf.h" +#import "EXPMatchers+beKindOf.h" +#import "EXPMatchers+beSubclassOf.h" +#import "EXPMatchers+conformTo.h" +#import "EXPMatchers+beTruthy.h" +#import "EXPMatchers+beFalsy.h" +#import "EXPMatchers+contain.h" +#import "EXPMatchers+beSupersetOf.h" +#import "EXPMatchers+haveCountOf.h" +#import "EXPMatchers+beIdenticalTo.h" +#import "EXPMatchers+beGreaterThan.h" +#import "EXPMatchers+beGreaterThanOrEqualTo.h" +#import "EXPMatchers+beLessThan.h" +#import "EXPMatchers+beLessThanOrEqualTo.h" +#import "EXPMatchers+beInTheRangeOf.h" +#import "EXPMatchers+beCloseTo.h" +#import "EXPMatchers+raise.h" +#import "EXPMatchers+raiseWithReason.h" +#import "EXPMatchers+respondTo.h" +#import "EXPMatchers+postNotification.h" +#import "EXPMatchers+beginWith.h" +#import "EXPMatchers+endWith.h" +#import "EXPMatchers+match.h" diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/Expecta.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/Expecta.h new file mode 100644 index 0000000..066e988 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/Expecta.h @@ -0,0 +1,15 @@ +#import + +//! Project version number for Expecta. +FOUNDATION_EXPORT double ExpectaVersionNumber; + +//! Project version string for Expecta. +FOUNDATION_EXPORT const unsigned char ExpectaVersionString[]; + +#import +#import +#import + +// Enable shorthand by default +#define expect(...) EXP_expect((__VA_ARGS__)) +#define failure(...) EXP_failure((__VA_ARGS__)) diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaObject.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaObject.h new file mode 100644 index 0000000..ef2a38a --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaObject.h @@ -0,0 +1,18 @@ +#import + +#define EXPObjectify(value) _EXPObjectify(@encode(__typeof__((value))), (value)) +#define EXP_expect(actual) _EXP_expect(self, __LINE__, __FILE__, ^id{ return EXPObjectify((actual)); }) +#define EXPMatcherInterface(matcherName, matcherArguments) _EXPMatcherInterface(matcherName, matcherArguments) +#define EXPMatcherImplementationBegin(matcherName, matcherArguments) _EXPMatcherImplementationBegin(matcherName, matcherArguments) +#define EXPMatcherImplementationEnd _EXPMatcherImplementationEnd +#define EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) + +#define EXP_failure(message) EXPFail(self, __LINE__, __FILE__, message) + + +@interface Expecta : NSObject + ++ (NSTimeInterval)asynchronousTestTimeout; ++ (void)setAsynchronousTestTimeout:(NSTimeInterval)timeout; + +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaSupport.h b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaSupport.h new file mode 100644 index 0000000..fb0ef4f --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Headers/ExpectaSupport.h @@ -0,0 +1,73 @@ +#import "EXPExpect.h" +#import "EXPBlockDefinedMatcher.h" + +#ifdef __cplusplus +extern "C" { +#endif + +id _EXPObjectify(const char *type, ...); +EXPExpect *_EXP_expect(id testCase, int lineNumber, const char *fileName, EXPIdBlock actualBlock); + +void EXPFail(id testCase, int lineNumber, const char *fileName, NSString *message); +NSString *EXPDescribeObject(id obj); + +void EXP_prerequisite(EXPBoolBlock block); +void EXP_match(EXPBoolBlock block); +void EXP_failureMessageForTo(EXPStringBlock block); +void EXP_failureMessageForNotTo(EXPStringBlock block); + +#if __has_feature(objc_arc) +#define _EXP_release(x) +#define _EXP_autorelease(x) (x) + +#else +#define _EXP_release(x) [x release] +#define _EXP_autorelease(x) [x autorelease] +#endif + +// workaround for the categories bug: http://developer.apple.com/library/mac/#qa/qa1490/_index.html +#define EXPFixCategoriesBug(name) \ +__attribute__((constructor)) static void EXPFixCategoriesBug##name() {} + +#define _EXPMatcherInterface(matcherName, matcherArguments) \ +@interface EXPExpect (matcherName##Matcher) \ +@property (nonatomic, readonly) void(^ matcherName) matcherArguments; \ +@end + +#define _EXPMatcherImplementationBegin(matcherName, matcherArguments) \ +EXPFixCategoriesBug(EXPMatcher##matcherName##Matcher); \ +@implementation EXPExpect (matcherName##Matcher) \ +@dynamic matcherName;\ +- (void(^) matcherArguments) matcherName { \ + EXPBlockDefinedMatcher *matcher = [[EXPBlockDefinedMatcher alloc] init]; \ + [[[NSThread currentThread] threadDictionary] setObject:matcher forKey:@"EXP_currentMatcher"]; \ + __block id actual = self.actual; \ + __block void (^prerequisite)(EXPBoolBlock block) = ^(EXPBoolBlock block) { EXP_prerequisite(block); }; \ + __block void (^match)(EXPBoolBlock block) = ^(EXPBoolBlock block) { EXP_match(block); }; \ + __block void (^failureMessageForTo)(EXPStringBlock block) = ^(EXPStringBlock block) { EXP_failureMessageForTo(block); }; \ + __block void (^failureMessageForNotTo)(EXPStringBlock block) = ^(EXPStringBlock block) { EXP_failureMessageForNotTo(block); }; \ + prerequisite(nil); match(nil); failureMessageForTo(nil); failureMessageForNotTo(nil); \ + void (^matcherBlock) matcherArguments = [^ matcherArguments { \ + { + +#define _EXPMatcherImplementationEnd \ + } \ + [self applyMatcher:matcher to:&actual]; \ + } copy]; \ + _EXP_release(matcher); \ + return _EXP_autorelease(matcherBlock); \ +} \ +@end + +#define _EXPMatcherAliasImplementation(newMatcherName, oldMatcherName, matcherArguments) \ +EXPFixCategoriesBug(EXPMatcher##newMatcherName##Matcher); \ +@implementation EXPExpect (newMatcherName##Matcher) \ +@dynamic newMatcherName;\ +- (void(^) matcherArguments) newMatcherName { \ + return [self oldMatcherName]; \ +}\ +@end + +#ifdef __cplusplus +} +#endif diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/LICENSE b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/LICENSE new file mode 100644 index 0000000..a036c85 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2015 Specta Team - https://github.com/specta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Resources/Info.plist b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..ecc0430 Binary files /dev/null and b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/A/Resources/Info.plist differ diff --git a/Frameworks/OCMock/OCMock.framework/Versions/Current b/ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/Current similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/Current rename to ConnectSDKIntegrationTests/Frameworks/Expecta.framework/Versions/Current diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Headers b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Headers similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Headers rename to ConnectSDKIntegrationTests/Frameworks/Specta.framework/Headers diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/LICENSE b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/LICENSE new file mode 120000 index 0000000..7da29fc --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/LICENSE @@ -0,0 +1 @@ +Versions/Current/LICENSE \ No newline at end of file diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Resources b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Resources similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Resources rename to ConnectSDKIntegrationTests/Frameworks/Specta.framework/Resources diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Specta b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Specta new file mode 120000 index 0000000..c6cd055 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Specta @@ -0,0 +1 @@ +Versions/Current/Specta \ No newline at end of file diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSharedExampleGroups.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSharedExampleGroups.h new file mode 100644 index 0000000..090acba --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSharedExampleGroups.h @@ -0,0 +1,17 @@ +#import +#import +#import + +@class _XCTestCaseImplementation; + +@class SPTExampleGroup; + +@interface SPTSharedExampleGroups : XCTestCase + ++ (void)addSharedExampleGroupWithName:(NSString *)name block:(SPTDictionaryBlock)block exampleGroup:(SPTExampleGroup *)exampleGroup; ++ (SPTDictionaryBlock)sharedExampleGroupWithName:(NSString *)name exampleGroup:(SPTExampleGroup *)exampleGroup; + +- (void)sharedExampleGroups; + +@end + diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSpec.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSpec.h new file mode 100644 index 0000000..ada4ea2 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SPTSpec.h @@ -0,0 +1,28 @@ +#import +#import + +@class + SPTTestSuite +, SPTCompiledExample +; + +@interface SPTSpec : XCTestCase + +@property (strong) XCTestCaseRun *spt_run; +@property (nonatomic) BOOL spt_pending; +@property (nonatomic) BOOL spt_skipped; + ++ (BOOL)spt_isDisabled; ++ (void)spt_setDisabled:(BOOL)disabled; ++ (BOOL)spt_focusedExamplesExist; ++ (SEL)spt_convertToTestMethod:(SPTCompiledExample *)example; ++ (SPTTestSuite *)spt_testSuite; ++ (void)spt_setCurrentTestSuite; ++ (void)spt_unsetCurrentTestSuite; ++ (void)spt_setCurrentTestSuiteFileName:(NSString *)fileName lineNumber:(NSUInteger)lineNumber; + +- (void)spec; +- (BOOL)spt_shouldRunExample:(SPTCompiledExample *)example; +- (void)spt_runExample:(SPTCompiledExample *)example; + +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/Specta.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/Specta.h new file mode 100644 index 0000000..dda17f9 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/Specta.h @@ -0,0 +1,14 @@ +#import +#import + +//! Project version number for Specta. +FOUNDATION_EXPORT double SpectaVersionNumber; + +//! Project version string for Specta. +FOUNDATION_EXPORT const unsigned char SpectaVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import +#import +#import diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaDSL.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaDSL.h new file mode 100644 index 0000000..d6a043c --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaDSL.h @@ -0,0 +1,81 @@ +#import + +#define SpecBegin(name) _SPTSpecBegin(name, __FILE__, __LINE__) +#define SpecEnd _SPTSpecEnd + +#define SharedExamplesBegin(name) _SPTSharedExampleGroupsBegin(name) +#define SharedExamplesEnd _SPTSharedExampleGroupsEnd +#define SharedExampleGroupsBegin(name) _SPTSharedExampleGroupsBegin(name) +#define SharedExampleGroupsEnd _SPTSharedExampleGroupsEnd + +typedef void (^DoneCallback)(void); + +OBJC_EXTERN void describe(NSString *name, void (^block)()); +OBJC_EXTERN void fdescribe(NSString *name, void (^block)()); + +OBJC_EXTERN void context(NSString *name, void (^block)()); +OBJC_EXTERN void fcontext(NSString *name, void (^block)()); + +OBJC_EXTERN void it(NSString *name, void (^block)()); +OBJC_EXTERN void fit(NSString *name, void (^block)()); + +OBJC_EXTERN void example(NSString *name, void (^block)()); +OBJC_EXTERN void fexample(NSString *name, void (^block)()); + +OBJC_EXTERN void specify(NSString *name, void (^block)()); +OBJC_EXTERN void fspecify(NSString *name, void (^block)()); + +#define pending(...) spt_pending_(__VA_ARGS__, nil) +#define xdescribe(...) spt_pending_(__VA_ARGS__, nil) +#define xcontext(...) spt_pending_(__VA_ARGS__, nil) +#define xexample(...) spt_pending_(__VA_ARGS__, nil) +#define xit(...) spt_pending_(__VA_ARGS__, nil) +#define xspecify(...) spt_pending_(__VA_ARGS__, nil) + +OBJC_EXTERN void beforeAll(void (^block)()); +OBJC_EXTERN void afterAll(void (^block)()); + +OBJC_EXTERN void beforeEach(void (^block)()); +OBJC_EXTERN void afterEach(void (^block)()); + +OBJC_EXTERN void before(void (^block)()); +OBJC_EXTERN void after(void (^block)()); + +OBJC_EXTERN void sharedExamplesFor(NSString *name, void (^block)(NSDictionary *data)); +OBJC_EXTERN void sharedExamples(NSString *name, void (^block)(NSDictionary *data)); + +#define itShouldBehaveLike(...) spt_itShouldBehaveLike_(@(__FILE__), __LINE__, __VA_ARGS__) +#define itBehavesLike(...) spt_itShouldBehaveLike_(@(__FILE__), __LINE__, __VA_ARGS__) + +OBJC_EXTERN void waitUntil(void (^block)(DoneCallback done)); + +OBJC_EXTERN void setAsyncSpecTimeout(NSTimeInterval timeout); + +// ---------------------------------------------------------------------------- + +#define _SPTSpecBegin(name, file, line) \ +@interface name##Spec : SPTSpec \ +@end \ +@implementation name##Spec \ +- (void)spec { \ + [[self class] spt_setCurrentTestSuiteFileName:(@(file)) lineNumber:(line)]; + +#define _SPTSpecEnd \ +} \ +@end + +#define _SPTSharedExampleGroupsBegin(name) \ +@interface name##SharedExampleGroups : SPTSharedExampleGroups \ +@end \ +@implementation name##SharedExampleGroups \ +- (void)sharedExampleGroups { + +#define _SPTSharedExampleGroupsEnd \ +} \ +@end + +OBJC_EXTERN void spt_it_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()); +OBJC_EXTERN void spt_fit_(NSString *name, NSString *fileName, NSUInteger lineNumber, void (^block)()); +OBJC_EXTERN void spt_pending_(NSString *name, ...); +OBJC_EXTERN void spt_itShouldBehaveLike_(NSString *fileName, NSUInteger lineNumber, NSString *name, id dictionaryOrBlock); +OBJC_EXTERN void spt_itShouldBehaveLike_block(NSString *fileName, NSUInteger lineNumber, NSString *name, NSDictionary *(^block)()); diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaTypes.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaTypes.h new file mode 100644 index 0000000..f1f0ae3 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/SpectaTypes.h @@ -0,0 +1,5 @@ +@class SPTSpec; + +typedef void (^SPTVoidBlock)(); +typedef void (^SPTSpecBlock)(SPTSpec *spec); +typedef void (^SPTDictionaryBlock)(NSDictionary *dictionary); diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/XCTestCase+Specta.h b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/XCTestCase+Specta.h new file mode 100644 index 0000000..9ca8f8a --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Headers/XCTestCase+Specta.h @@ -0,0 +1,7 @@ +#import + +@interface XCTestCase (Specta) + +- (void)spt_handleException:(NSException *)exception; + +@end diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/LICENSE b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/LICENSE new file mode 100644 index 0000000..ca257c0 --- /dev/null +++ b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2012-2014 Specta Team. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Resources/Info.plist b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..6a8577f Binary files /dev/null and b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Resources/Info.plist differ diff --git a/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Specta b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Specta new file mode 100644 index 0000000..b463428 Binary files /dev/null and b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/A/Specta differ diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/Current b/ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/Current similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/Current rename to ConnectSDKIntegrationTests/Frameworks/Specta.framework/Versions/Current diff --git a/ConnectSDKIntegrationTests/Info.plist b/ConnectSDKIntegrationTests/Info.plist new file mode 100644 index 0000000..cb399fd --- /dev/null +++ b/ConnectSDKIntegrationTests/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + com.connectsdk.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.h b/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.h new file mode 100644 index 0000000..ef4b5f6 --- /dev/null +++ b/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.h @@ -0,0 +1,32 @@ +// +// OCMStubRecorder+SpectaAsync.h +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/27/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN +@interface OCMStubRecorder (SpectaAsync) + +/// Convenience method to call the Specta's @c DoneCallback received from the +/// @c waitUntil() method. +- (id)andDoneWaiting:(DoneCallback)done; + +@end +NS_ASSUME_NONNULL_END diff --git a/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.m b/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.m new file mode 100644 index 0000000..2a0d1c3 --- /dev/null +++ b/ConnectSDKIntegrationTests/OCMStubRecorder+SpectaAsync.m @@ -0,0 +1,31 @@ +// +// OCMStubRecorder+SpectaAsync.m +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/27/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "OCMStubRecorder+SpectaAsync.h" + +@implementation OCMStubRecorder (SpectaAsync) + +- (id __nonnull)andDoneWaiting:(DoneCallback __nonnull)done { + return [self andDo:^(NSInvocation *_) { + done(); + }]; +} + +@end diff --git a/ConnectSDKTests/Frameworks/OCMock.framework/Headers b/ConnectSDKTests/Frameworks/OCMock.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/ConnectSDKTests/Frameworks/OCMock.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Frameworks/OCMock/OCMock.framework/License.txt b/ConnectSDKTests/Frameworks/OCMock.framework/License.txt similarity index 100% rename from Frameworks/OCMock/OCMock.framework/License.txt rename to ConnectSDKTests/Frameworks/OCMock.framework/License.txt diff --git a/Frameworks/OCMock/OCMock.framework/OCMock b/ConnectSDKTests/Frameworks/OCMock.framework/OCMock similarity index 100% rename from Frameworks/OCMock/OCMock.framework/OCMock rename to ConnectSDKTests/Frameworks/OCMock.framework/OCMock diff --git a/ConnectSDKTests/Frameworks/OCMock.framework/Resources b/ConnectSDKTests/Frameworks/OCMock.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/ConnectSDKTests/Frameworks/OCMock.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/NSNotificationCenter+OCMAdditions.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMArg.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMArg.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMArg.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMConstraint.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMConstraint.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMConstraint.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMLocation.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMLocation.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMLocation.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMMacroState.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMMacroState.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMMacroState.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMRecorder.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMRecorder.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMRecorder.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMStubRecorder.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMock.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMock.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMock.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMockObject.h b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Headers/OCMockObject.h rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Headers/OCMockObject.h diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/OCMock b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/OCMock similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/OCMock rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/OCMock diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Resources/Info.plist b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Resources/Info.plist rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Resources/Info.plist diff --git a/Frameworks/OCMock/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings similarity index 100% rename from Frameworks/OCMock/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings rename to ConnectSDKTests/Frameworks/OCMock.framework/Versions/A/Resources/en.lproj/InfoPlist.strings diff --git a/ConnectSDKTests/Frameworks/OCMock.framework/Versions/Current b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/ConnectSDKTests/Frameworks/OCMock.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Headers b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Headers new file mode 120000 index 0000000..a177d2a --- /dev/null +++ b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Headers @@ -0,0 +1 @@ +Versions/Current/Headers \ No newline at end of file diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/LICENSE b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/LICENSE similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/LICENSE rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/LICENSE diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/OHHTTPStubs b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/OHHTTPStubs similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/OHHTTPStubs rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/OHHTTPStubs diff --git a/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Resources b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubs.h b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubs.h similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubs.h rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubs.h diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+HTTPMessage.h b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+HTTPMessage.h similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+HTTPMessage.h rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+HTTPMessage.h diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+JSON.h b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+JSON.h similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+JSON.h rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse+JSON.h diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse.h b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse.h similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse.h rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Headers/OHHTTPStubsResponse.h diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/OHHTTPStubs b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/OHHTTPStubs similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/OHHTTPStubs rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/OHHTTPStubs diff --git a/Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Resources/Info.plist b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Resources/Info.plist similarity index 100% rename from Frameworks/OHHTTPStubs/OHHTTPStubs.framework/Versions/A/Resources/Info.plist rename to ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/A/Resources/Info.plist diff --git a/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/Current b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/Current new file mode 120000 index 0000000..8c7e5a6 --- /dev/null +++ b/ConnectSDKTests/Frameworks/OHHTTPStubs.framework/Versions/Current @@ -0,0 +1 @@ +A \ No newline at end of file diff --git a/ConnectSDKTests/OCMArg+ArgumentCaptor.h b/ConnectSDKTests/OCMArg+ArgumentCaptor.h new file mode 100644 index 0000000..949e2e2 --- /dev/null +++ b/ConnectSDKTests/OCMArg+ArgumentCaptor.h @@ -0,0 +1,30 @@ +// +// OCMArg+ArgumentCaptor.h +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/13/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@interface OCMArg (ArgumentCaptor) + +/// Convenience method to capture an argument for later use/verification. ++ (id)captureTo:(out __strong __nullable id *__nonnull)objectPointer; + +@end +NS_ASSUME_NONNULL_END diff --git a/ConnectSDKTests/OCMArg+ArgumentCaptor.m b/ConnectSDKTests/OCMArg+ArgumentCaptor.m new file mode 100644 index 0000000..7bb71fa --- /dev/null +++ b/ConnectSDKTests/OCMArg+ArgumentCaptor.m @@ -0,0 +1,32 @@ +// +// OCMArg+ArgumentCaptor.m +// ConnectSDK +// +// Created by Eugene Nikolskyi on 5/13/15. +// Copyright (c) 2015 LG Electronics. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import "OCMArg+ArgumentCaptor.h" + +@implementation OCMArg (ArgumentCaptor) + ++ (id __nonnull)captureTo:(out id __nullable __strong *__nonnull)objectPointer { + return [[self class] checkWithBlock:^BOOL(id obj) { + *objectPointer = obj; + return YES; + }]; +} + +@end diff --git a/ConnectSDKTests/OCMStubRecorder+XCTestExpectation.h b/ConnectSDKTests/OCMStubRecorder+XCTestExpectation.h index 44c96da..e5aea80 100644 --- a/ConnectSDKTests/OCMStubRecorder+XCTestExpectation.h +++ b/ConnectSDKTests/OCMStubRecorder+XCTestExpectation.h @@ -18,11 +18,13 @@ // limitations under the License. // -#import +#import +NS_ASSUME_NONNULL_BEGIN @interface OCMStubRecorder (XCTestExpectation) /// Convenience method to fulfill an @c XCTestExpectation with a stub. - (id)andFulfillExpectation:(XCTestExpectation *)expectation; @end +NS_ASSUME_NONNULL_END