Commit 222f07be authored by 汪洋's avatar 汪洋

save progress

parent efbbe85b
...@@ -8,7 +8,6 @@ inhibit_all_warnings! ...@@ -8,7 +8,6 @@ inhibit_all_warnings!
target 'GMPhobos_Example' do target 'GMPhobos_Example' do
pod 'GMPhobos', :path => '../' pod 'GMPhobos', :path => '../'
pod 'GMCache', '0.2.0'
target 'GMPhobos_Tests' do target 'GMPhobos_Tests' do
inherit! :search_paths inherit! :search_paths
end end
......
...@@ -36,7 +36,7 @@ PODS: ...@@ -36,7 +36,7 @@ PODS:
- Masonry (= 1.1.0) - Masonry (= 1.1.0)
- SDWebImage (= 3.7.6) - SDWebImage (= 3.7.6)
- GMPhobos (0.5.4): - GMPhobos (0.5.4):
- GMCache - GMCache (= 0.2.0)
- GMKit - GMKit
- Masonry (1.1.0) - Masonry (1.1.0)
- SDWebImage (3.7.6): - SDWebImage (3.7.6):
...@@ -45,7 +45,6 @@ PODS: ...@@ -45,7 +45,6 @@ PODS:
- TMCache (2.1.0) - TMCache (2.1.0)
DEPENDENCIES: DEPENDENCIES:
- GMCache (= 0.2.0)
- GMPhobos (from `../`) - GMPhobos (from `../`)
EXTERNAL SOURCES: EXTERNAL SOURCES:
...@@ -55,11 +54,11 @@ EXTERNAL SOURCES: ...@@ -55,11 +54,11 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e GMCache: b7d48432ee2469eb0c6c86c720a1958bd373187e
GMKit: a30da06b84e5c4a357d427c70d1b5ec672a1f6a1 GMKit: a30da06b84e5c4a357d427c70d1b5ec672a1f6a1
GMPhobos: 9549afe9e949fadc2ac54e4bb26cb4c2519cd417 GMPhobos: c188895332709d25d1c25fc6efe584bb669e8420
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9 SDWebImage: c325cf02c30337336b95beff20a13df489ec0ec9
TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed TMCache: 95ebcc9b3c7e90fb5fd8fc3036cba3aa781c9bed
PODFILE CHECKSUM: 88bad4cf7811c4caa54519587b95fcc2e18bc404 PODFILE CHECKSUM: ea0fac2144ac80baf8f21576cde49526c19991ad
COCOAPODS: 1.4.0 COCOAPODS: 1.4.0
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#import <GMPhobos/Phobos.h> #import <GMPhobos/Phobos.h>
#import <GMCache/WMCacheService.h>
#import "GMPhobosController.h" #import "GMPhobosController.h"
#define PhobosCacheKey @"PhobosCacheKey" #define PhobosCacheKey @"PhobosCacheKey"
@import GMCache;
NSString *const MockAppName = @"gengmei_test"; NSString *const MockAppName = @"gengmei_test";
NSString *const MockChannelId = @"AppStore"; NSString *const MockChannelId = @"AppStore";
...@@ -20,7 +20,6 @@ NSString *const MockCityId = @"beijing"; ...@@ -20,7 +20,6 @@ NSString *const MockCityId = @"beijing";
@interface GMPhotoTest : XCTestCase @interface GMPhotoTest : XCTestCase
@property Phobos *client; @property Phobos *client;
@property WMCacheService *cache;
@end @end
@implementation GMPhotoTest @implementation GMPhotoTest
...@@ -29,14 +28,12 @@ NSString *const MockCityId = @"beijing"; ...@@ -29,14 +28,12 @@ NSString *const MockCityId = @"beijing";
[super setUp]; [super setUp];
_client = [Phobos clientWithAppName:MockAppName channelId:MockChannelId]; _client = [Phobos clientWithAppName:MockAppName channelId:MockChannelId];
[Phobos setSharedClient:_client]; [Phobos setSharedClient:_client];
_cache = [WMCacheService sharedInstance];
} }
- (void)tearDown { - (void)tearDown {
// Put teardown code here. This method is called after the invocation of each test method in the class. // Put teardown code here. This method is called after the invocation of each test method in the class.
[super tearDown]; [super tearDown];
[_cache removeObjectAtDucmentPathWithkey:PhobosCacheKey]; [GMCache removeObjectAtDucmentPathWithkey:PhobosCacheKey];
} }
/** /**
...@@ -48,7 +45,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -48,7 +45,7 @@ NSString *const MockCityId = @"beijing";
[_client setUserId:MockUserId]; [_client setUserId:MockUserId];
[_client setCurrentCityId:MockCityId]; [_client setCurrentCityId:MockCityId];
[Phobos track:MockEventId]; [Phobos track:MockEventId];
NSArray *array = [_cache fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count == 1, @"array is empty"); XCTAssertTrue(array.count == 1, @"array is empty");
NSDictionary *dict = [array objectAtIndex:0]; NSDictionary *dict = [array objectAtIndex:0];
[self verfiyDict:dict]; [self verfiyDict:dict];
...@@ -62,7 +59,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -62,7 +59,7 @@ NSString *const MockCityId = @"beijing";
*/ */
- (void)testTrackEventWithoutAttr{ - (void)testTrackEventWithoutAttr{
[Phobos track:MockEventId]; [Phobos track:MockEventId];
NSArray *array = [_cache fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count == 1, @"array is empty"); XCTAssertTrue(array.count == 1, @"array is empty");
NSDictionary *dict = [array objectAtIndex:0]; NSDictionary *dict = [array objectAtIndex:0];
[self verfiyDict:dict]; [self verfiyDict:dict];
...@@ -77,7 +74,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -77,7 +74,7 @@ NSString *const MockCityId = @"beijing";
- (void)testTrackEventWithAttr{ - (void)testTrackEventWithAttr{
NSDictionary *attr = @{@"attr":@"track_attr"}; NSDictionary *attr = @{@"attr":@"track_attr"};
[Phobos track:MockEventId attributes:attr]; [Phobos track:MockEventId attributes:attr];
NSArray *array = [_cache fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count == 1, @"array is empty"); XCTAssertTrue(array.count == 1, @"array is empty");
NSDictionary *dict = [array objectAtIndex:0]; NSDictionary *dict = [array objectAtIndex:0];
[self verfiyDict:dict]; [self verfiyDict:dict];
...@@ -98,7 +95,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -98,7 +95,7 @@ NSString *const MockCityId = @"beijing";
// When // When
[Phobos track:MockEventId attributes:attr sendNow:YES]; [Phobos track:MockEventId attributes:attr sendNow:YES];
// Then // Then
NSArray *array = [_cache fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count == 0, @"array should be empty"); XCTAssertTrue(array.count == 0, @"array should be empty");
} }
...@@ -142,7 +139,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -142,7 +139,7 @@ NSString *const MockCityId = @"beijing";
[controller viewWillAppear:true]; [controller viewWillAppear:true];
[controller viewWillDisappear:true]; [controller viewWillDisappear:true];
[self paramUnNilCheck]; [self paramUnNilCheck];
NSArray *array = [[WMCacheService sharedInstance] fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count != 0, @"PhobosCacheKey 下面应该有数据"); XCTAssertTrue(array.count != 0, @"PhobosCacheKey 下面应该有数据");
NSDictionary *dic = array[0][@"params"]; NSDictionary *dic = array[0][@"params"];
...@@ -156,7 +153,7 @@ NSString *const MockCityId = @"beijing"; ...@@ -156,7 +153,7 @@ NSString *const MockCityId = @"beijing";
} }
- (void)paramUnNilCheck { - (void)paramUnNilCheck {
NSArray *array = [[WMCacheService sharedInstance] fetchObjectAtDucmentPathWithkey:PhobosCacheKey]; NSArray *array = [GMCache fetchObjectAtDucmentPathWithkey:PhobosCacheKey];
XCTAssertTrue(array.count != 0, @"PhobosCacheKey 下面应该有数据"); XCTAssertTrue(array.count != 0, @"PhobosCacheKey 下面应该有数据");
NSDictionary *dic = array[0][@"params"]; NSDictionary *dic = array[0][@"params"];
......
...@@ -18,17 +18,13 @@ Pod::Spec.new do |s| ...@@ -18,17 +18,13 @@ Pod::Spec.new do |s|
DESC DESC
s.homepage = "http://git.wanmeizhensuo.com/gengmeiios/GMPhobos" s.homepage = "http://git.wanmeizhensuo.com/gengmeiios/GMPhobos"
# s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2"
s.license = 'MIT' s.license = 'MIT'
s.author = { "licong" => "licong@gmei.com" } s.author = { "licong" => "licong@gmei.com" }
s.source = { :git => "git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git", :tag => s.version.to_s } s.source = { :git => "git@git.wanmeizhensuo.com:gengmeiios/GMPhobos.git", :tag => s.version.to_s }
# s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
s.platform = :ios, '8.0' s.platform = :ios, '8.0'
s.requires_arc = true s.source_files = 'GMPhobos/Classes/*.{h,m}'
s.dependency 'GMCache', '0.2.0'
s.source_files = 'Pod/Classes/**/*'
s.dependency 'GMCache'
s.dependency 'GMKit' s.dependency 'GMKit'
s.library = 'z' s.library = 'z'
......
...@@ -9,7 +9,7 @@ Phobos is named after the Greek god Phobos, a son of Ares (Mars) and Aphrodite ( ...@@ -9,7 +9,7 @@ Phobos is named after the Greek god Phobos, a son of Ares (Mars) and Aphrodite (
The name "Phobos" is pronounced /ˈfoʊbəs/ foh-bəs, or like the Greek Φόβος. The name "Phobos" is pronounced /ˈfoʊbəs/ foh-bəs, or like the Greek Φόβος.
## Requirements ## Requirements
Require WMCacheService and libz Require GMCache and libz
## Installation ## Installation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment