Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace PKAssert with Expecta

  • Loading branch information...
commit f8aa4686f8ff00a26e27b57a4cbc6b5d004b32a7 1 parent 39b93b5
Sebastian Rehnby sebreh authored
4 Podfile
View
@@ -11,7 +11,9 @@ target :podiokittests do
pod 'PodioKit', :path => '.'
- pod 'OHHTTPStubs', '1.1.1'
+ pod 'OHHTTPStubs'
+ pod 'Expecta'
+ pod 'OCMock'
end
target :demoapp do
8 Podfile.lock
View
@@ -1,12 +1,16 @@
PODS:
- AFNetworking (1.3.3)
+ - Expecta (0.2.3)
+ - OCMock (2.2.2)
- OHHTTPStubs (1.1.1)
- PodioKit (1.1.0):
- AFNetworking (= 1.3.3)
DEPENDENCIES:
- AFNetworking (= 1.3.3)
- - OHHTTPStubs (= 1.1.1)
+ - Expecta
+ - OCMock
+ - OHHTTPStubs
- PodioKit (from `.`)
EXTERNAL SOURCES:
@@ -15,6 +19,8 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66
+ Expecta: dbc4a27fabb853bdd2e907e33f11ee43a9a47d0c
+ OCMock: ffba68873fd32cfd35d885bddad23bfa816da4a3
OHHTTPStubs: cb1cef742f2fba18b192fb92ede52a69cf3a04d5
PodioKit: 055960e5418032589f05c61ec7a0c29048f776c6
2  PodioKit.xcodeproj/project.pbxproj
View
@@ -459,7 +459,6 @@
5065C0FA14345ECB00360855 /* CFNetwork.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CFNetwork.framework; path = System/Library/Frameworks/CFNetwork.framework; sourceTree = SDKROOT; };
5065C0FC14345F0D00360855 /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; };
5065C0FD14345F0D00360855 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- 507CA05E1503E42700678F9D /* PKTestAssert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PKTestAssert.h; sourceTree = "<group>"; };
507CA0611503E5D400678F9D /* PodioKitTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PodioKitTests-Prefix.pch"; sourceTree = "<group>"; };
507CA06A1503E8B500678F9D /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
507D09F91823EB3600AFBFB1 /* PKPromotionAPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PKPromotionAPI.h; sourceTree = "<group>"; };
@@ -934,7 +933,6 @@
5065BF0314335ABA00360855 /* PodioKitTests */ = {
isa = PBXGroup;
children = (
- 507CA05E1503E42700678F9D /* PKTestAssert.h */,
50F4FBD6144C088000317E62 /* PKAsyncTestCase.h */,
50F4FBD7144C088000317E62 /* PKAsyncTestCase.m */,
50D73870166F7C59009233FF /* API Client */,
12 PodioKitTests/PKNumberFormatTests.m
View
@@ -17,18 +17,18 @@ @implementation PKNumberFormatTests
- (void)testNumberToString {
NSString *string = [@43.4565 pk_numberStringWithUSLocale];
- STAssertTrue([string isEqualToString:@"43.4565"], @"String did not match expected 43.4565, got %@", string);
+ expect(string).to.equal(@"43.4565");
- NSString *string2 = [@32 pk_numberStringWithUSLocale];
- STAssertTrue([string2 isEqualToString:@"32"], @"String did not match expected 32, got %@", string2);
+ string = [@32 pk_numberStringWithUSLocale];
+ expect(string).to.equal(@"32");
}
- (void)testStringToNumber {
NSNumber *number = [NSNumber pk_numberFromStringWithUSLocale:@"43.4565"];
- STAssertTrue([number isEqualToNumber:@43.4565], @"Number did not match expected 43.4565, got %@", number);
+ expect(number).to.equal(@43.4565);
- NSNumber *number2 = [NSNumber pk_numberFromStringWithUSLocale:@"32"];
- STAssertTrue([number2 isEqualToNumber:@32], @"Number did not match expected 32, got %@", number2);
+ number = [NSNumber pk_numberFromStringWithUSLocale:@"32"];
+ expect(number).to.equal(@32);
}
@end
26 PodioKitTests/PKTaskMappingTests.m
View
@@ -11,18 +11,6 @@
#import "PKDefaultObjectRepository.h"
#import "PKTestTaskMapping.h"
#import "PKTestTask.h"
-#import "PKAssert.h"
-
-
-@interface PKTaskMappingTests ()
-
-- (PKObjectMapper *)createObjectMapperWithMapping:(PKObjectMapping *)mapping;
-
-- (id)dataWithContentsOfJSONFile:(NSString *)filename;
-
-- (void)validateTask:(PKTestTask *)task;
-
-@end
@implementation PKTaskMappingTests
@@ -57,8 +45,8 @@ - (void)testGetActiveTasks {
};
NSArray *result = [mapper performMappingWithData:data];
+ expect(result).to.haveCountOf(5);
- PKAssertEquals([result count], 5);
[result enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[self validateTask:obj];
}];
@@ -73,16 +61,16 @@ - (void)testGetTask {
};
id task = [mapper performMappingWithData:data];
- STAssertTrue([task isKindOfClass:[PKTestTask class]], @"Wrong class, expected PKTask, got %@", [task class]);
+ expect(task).to.beInstanceOf([PKTestTask class]);
[self validateTask:task];
}
- (void)validateTask:(PKTestTask *)task {
- PKAssertGreaterThanZero(task.taskId);
- PKAssertNotNil(task.text);
- PKAssertGreaterThanZero(task.type);
- PKAssertGreaterThanZero(task.status);
- PKAssertNotNil(task.createdOn);
+ expect(task.taskId).to.beGreaterThan(0);
+ expect(task.text).notTo.beNil();
+ expect(task.type).to.beGreaterThan(0);
+ expect(task.status).to.beGreaterThan(0);
+ expect(task.createdOn).notTo.beNil();
}
@end
15 PodioKitTests/PKTestAssert.h
View
@@ -1,15 +0,0 @@
-//
-// PKTestAssert.h
-// PodioKit
-//
-// Created by Sebastian Rehnby on 3/4/12.
-// Copyright (c) 2012 Citrix Systems, Inc. All rights reserved.
-//
-
-#import <SenTestingKit/SenTestingKit.h>
-
-#define PKAssertNil(a1) STAssertTrue(a1 == nil, @"Should be nil")
-#define PKAssertNotNil(a1) STAssertTrue(a1 != nil, @"Should not be nil")
-#define PKAssertGreaterThanZero(a1) STAssertTrue(a1 > 0, @"Should be greater than 0")
-#define PKAssertZero(a1) STAssertTrue(a1 == 0, @"Should be 0")
-#define PKAssertEquals(a1, a2) STAssertTrue(a1 == a2, @"Should be equal")
4 PodioKitTests/PodioKitTests-Prefix.pch
View
@@ -7,5 +7,7 @@
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#import <PodioKit/PodioKit.h>
- #import "PKTestAssert.h"
+
+ #define EXP_SHORTHAND
+ #import <Expecta/Expecta.h>
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.