Skip to content

Commit 550c488

Browse files
committed
RACSequenceExample: use not deprecated archiving API.
Implement the old less secure logic using modern API. For test it's enough.
1 parent 81b0185 commit 550c488

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ReactiveObjCTests/RACSequenceExamples.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,15 @@ + (void)configure:(Configuration *)configuration {
107107
});
108108

109109
qck_it(@"should archive", ^{
110-
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:sequence];
110+
NSError *error;
111+
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:sequence requiringSecureCoding:NO error:&error];
111112
expect(data).notTo(beNil());
112113

113-
RACSequence *unarchived = [NSKeyedUnarchiver unarchiveObjectWithData:data];
114+
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingFromData:data error:&error];
115+
expect(error).to(beNil());
116+
117+
unarchiver.requiresSecureCoding = NO;
118+
RACSequence *unarchived = [unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
114119
expect(unarchived).to(equal(sequence));
115120
});
116121

0 commit comments

Comments
 (0)