File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1717#import " PFConfig.h"
1818#import " PFConfigController.h"
1919#import " PFTestCase.h"
20+ #import " PFPersistenceController.h"
21+ #import " PFPersistenceGroup.h"
22+
23+ @protocol ConfigControllerDataSource <PFCommandRunnerProvider, PFPersistenceControllerProvider>
24+
25+ @end
2026
2127@interface ConfigControllerTests : PFTestCase
2228
2329@end
2430
2531@implementation ConfigControllerTests
2632
33+ // /--------------------------------------
34+ #pragma mark - Helpers
35+ // /--------------------------------------
36+
37+ - (PFPersistenceController *)mockedPersistenceController {
38+ id controller = PFStrictClassMock ([PFPersistenceController class ]);
39+ id group = PFProtocolMock (@protocol (PFPersistenceGroup));
40+ OCMStub ([controller getPersistenceGroupAsync ]).andReturn ([BFTask taskWithResult: group]);
41+ return controller;
42+ }
43+
2744// /--------------------------------------
2845#pragma mark - Tests
2946// /--------------------------------------
@@ -50,8 +67,9 @@ - (void)testFetch {
5067 forCommandsPassingTest: ^BOOL (id obj) {
5168 return YES ;
5269 }];
53- id dataSource = PFStrictProtocolMock (@protocol (PFCommandRunnerProvider ));
70+ id dataSource = PFStrictProtocolMock (@protocol (ConfigControllerDataSource ));
5471 OCMStub ([dataSource commandRunner ]).andReturn (commandRunner);
72+ OCMStub ([dataSource persistenceController ]).andReturn ([self mockedPersistenceController ]);
5573
5674 PFConfigController *configController = [[PFConfigController alloc ] initWithDataSource: dataSource];
5775
You can’t perform that action at this time.
0 commit comments