From 086a23661d969c8df9f88c2a7e8cdc47ec2ffc19 Mon Sep 17 00:00:00 2001 From: Keith Duncan Date: Wed, 4 Dec 2013 16:23:07 +0000 Subject: [PATCH] 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. --- TestApplication/TestAppDelegate.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TestApplication/TestAppDelegate.m b/TestApplication/TestAppDelegate.m index b3ae35e..4d57673 100644 --- a/TestApplication/TestAppDelegate.m +++ b/TestApplication/TestAppDelegate.m @@ -10,6 +10,7 @@ #import "SQRLDirectoryManager.h" #import "SQRLShipItLauncher.h" #import "SQRLTestUpdate.h" +#import "SQRLDownloadedUpdate.h" #import #import @@ -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]