Skip to content

Commit

Permalink
Minor fixes in syntax and descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
dcordero committed Sep 24, 2013
1 parent 135a67f commit a33a4b4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
3 changes: 1 addition & 2 deletions Mantle/MTLJSONAdapter.h
Expand Up @@ -98,8 +98,7 @@ extern const NSInteger MTLJSONAdapterErrorInvalidJSONDictionary;
//
// JSONDictionary - A dictionary representing JSON data. This should match the
// format returned by NSJSONSerialization. If this argument is
// nil, the method returns nil and set error to
// MTLJSONAdapterErrorInvalidJSONDictionary.
// nil, the method returns nil and an error with code MTLJSONAdapterErrorInvalidJSONDictionary.
// modelClass - The MTLModel subclass to attempt to parse from the JSON.
// This class must conform to <MTLJSONSerializing>. This
// argument must not be nil.
Expand Down
3 changes: 1 addition & 2 deletions Mantle/MTLJSONAdapter.m
Expand Up @@ -79,8 +79,7 @@ - (id)initWithJSONDictionary:(NSDictionary *)JSONDictionary modelClass:(Class)mo
NSLocalizedDescriptionKey: NSLocalizedString(@"Invalid JSONDictionary", @""),
NSLocalizedFailureReasonErrorKey: NSLocalizedString(@"The JSONDictionary parameter is invalid.", @"")
};
*error = [NSError errorWithDomain:MTLJSONAdapterErrorDomain code:MTLJSONAdapterErrorInvalidJSONDictionary
userInfo:userInfo];
*error = [NSError errorWithDomain:MTLJSONAdapterErrorDomain code:MTLJSONAdapterErrorInvalidJSONDictionary userInfo:userInfo];
}
return nil;
}
Expand Down
5 changes: 1 addition & 4 deletions MantleTests/MTLJSONAdapterSpec.m
Expand Up @@ -73,7 +73,7 @@
expect([MTLJSONAdapter JSONDictionaryFromModel:model]).to.equal(values);
});

it(@"should return nil with a nil JSON dictionary, and invalid json error", ^{
it(@"should return nil and an error with a nil JSON dictionary", ^{
NSError *error = nil;
MTLJSONAdapter *adapter = [[MTLJSONAdapter alloc] initWithJSONDictionary:nil modelClass:MTLTestModel.class error:&error];
expect(adapter).to.beNil();
Expand Down Expand Up @@ -153,6 +153,3 @@
});

SpecEnd



0 comments on commit a33a4b4

Please sign in to comment.