Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (29 sloc) 1.334 kb
#import "SpecHelper.h"
#import "InjectionErrorFixtures.h"
#import "Fixtures.h"
JSObjectionInjector *injector = [JSObjection createInjector];
[JSObjection setDefaultInjector:injector];
it(@"throws an exception if property type is not an object", ^{
[[JSObjection defaultInjector] getObject:[UnsupportedPropertyObject class]];
}) should] raiseWithReason:@"Unable to determine class type for property declaration: 'myInteger'"];
it(@"throws an exception if property cannot be found", ^{
[[JSObjection defaultInjector] getObject:[BadPropertyObject class]];
}) should] raiseWithReason:@"Unable to find property declaration: 'badProperty'"];
it(@"throws if an object requires a protocol that does not exist in the context", ^{
[[JSObjection defaultInjector] getObject:[ManualCar class]];
}) should] raiseWithReason:@"Cannot find an instance that is bound to the protocol 'GearBox' to assign to the property 'gearBox'"];
it(@"throws if instantiation rule is not valid", ^{
[JSObjection registerClass:[CarFactory class] lifeCycle:3];
}) should] raiseWithReason:@"Invalid Instantiation Rule"];
Jump to Line
Something went wrong with that request. Please try again.