Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 693 Bytes
// NSDataTest.m
// YAJLIPhone
// Created by Gabriel Handford on 10/7/09.
// Copyright 2009. All rights reserved.
#import "YAJLTestCase.h"
#import "NSObject+YAJL.h"
@interface NSDataTest : YAJLTestCase
@implementation NSDataTest
- (void)testExample {
NSData *data = [[self loadString:@"example"] dataUsingEncoding:NSUTF8StringEncoding];
id JSON = [data yajl_JSON];
GHTestLog([JSON description]);
GHAssertTrue([JSON isKindOfClass:[NSDictionary class]], nil);
NSDictionary *glossary = [JSON objectForKey:@"glossary"];
GHAssertNotNil(glossary, nil);
NSString *title = [glossary objectForKey:@"title"];
GHAssertEqualStrings(title, @"example glossary", nil);
Jump to Line
Something went wrong with that request. Please try again.