Latest 0.1.0
Homepage https://github.com/thiagolioy/TLJsonFactory
License MIT
Platforms ios 7.0, requires ARC
Authors

Twitter: @tplioy
CI Status
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

TLJsonFactory is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "TLJsonFactory"

Usage

describe(@"loading from array json", ^{
    it(@"should be able to load json and convert to array", ^{
        NSArray *json = [TLJsonFactory tl_jsonArrayFromFile:@"addresses"];
        expect(json).notTo.beNil();
        expect(json).notTo.beEmpty();
    });

    it(@"should have the expected zipcode for json's first object", ^{
        NSArray *json = [TLJsonFactory tl_jsonArrayFromFile:@"addresses"];
        NSDictionary *dc = json.firstObject;
        NSString *zipcode = [dc objectForKey:@"zipcode"];
        expect(zipcode).to.equal(@"12345-678");
    });
});
describe(@"loading from dictionary json", ^{
    it(@"should be able to load json and convert to dictionary", ^{
        NSDictionary *json = [TLJsonFactory tl_jsonDictFromFile:@"address"];
        expect(json).notTo.beNil();
        expect(json).notTo.beEmpty();
    });

    it(@"should have the expected zipcode for json's object", ^{
        NSDictionary *json = [TLJsonFactory tl_jsonDictFromFile:@"address"];
        NSString *zipcode = [json objectForKey:@"zipcode"];
        expect(zipcode).to.equal(@"12345-678");
    });
});

Author

Thiago Lioy, [email protected]

License

TLJsonFactory is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "TLJsonFactory",
    "version": "0.1.0",
    "summary": "Helper pod to load json into objects for testing purposes.",
    "homepage": "https://github.com/thiagolioy/TLJsonFactory",
    "license": "MIT",
    "authors": {
        "Thiago Lioy": "[email protected]"
    },
    "source": {
        "git": "https://github.com/thiagolioy/TLJsonFactory.git",
        "tag": "0.1.0"
    },
    "platforms": {
        "ios": "7.0"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resource_bundles": {
        "TLJsonFactory": [
            "Pod/Assets/*.png"
        ]
    },
    "public_header_files": "Pod/Classes/**/*.h"
}

Pin It on Pinterest

Share This