Skip to content

Instantly share code, notes, and snippets.

@userow
Last active August 21, 2017 14:56
Show Gist options
  • Save userow/13b05bcc14072f2d0d7ca944ab74f32c to your computer and use it in GitHub Desktop.
Save userow/13b05bcc14072f2d0d7ca944ab74f32c to your computer and use it in GitHub Desktop.
//
// CounterSpecs.m
//
#import <Specta.h>
#define EXP_SHORTHAND
#import <Expecta.h>
#import "Counter.h"
SpecBegin(CounterSpecs)
/*
1) counter
*/
describe(@"Counter", ^{
it (@"can be serialied and deserialized", ^{
Counter *cnt = [Counter counterWithIncrement:1
limit:3
current:2];
NSData *encodedObject = [NSKeyedArchiver archivedDataWithRootObject:cnt];
Counter *unnarchived = (Counter *)[NSKeyedUnarchiver unarchiveObjectWithData:encodedObject];
expect(cnt).to.equal(unnarchived);
});
});
SpecEnd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment