Broadcast the received updates

Uses the JSON serialisation of the downloaded update, this is so I can tell test application to update, then run assertions on the downloadedUpdate from the otest process.
This commit is contained in:
Keith Duncan
2013-12-04 16:23:07 +00:00
parent e1460343ff
commit 086a23661d
+5
View File
@@ -10,6 +10,7 @@
#import "SQRLDirectoryManager.h"
#import "SQRLShipItLauncher.h"
#import "SQRLTestUpdate.h"
#import "SQRLDownloadedUpdate.h"
#import <ReactiveCocoa/EXTScope.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
@@ -74,6 +75,10 @@
}]
doNext:^(SQRLDownloadedUpdate *update) {
NSLog(@"Got a candidate update: %@", update);
NSString *serialisedUpdate = [[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:[MTLJSONAdapter JSONDictionaryFromModel:update] options:0 error:NULL] encoding:NSUTF8StringEncoding];
[NSDistributedNotificationCenter.defaultCenter postNotificationName:@"com.github.Squirrel.TestApplication.updateReceived" object:nil userInfo:@{ @"update": serialisedUpdate }];
}]
// Retry until we get the expected release.
repeat]