diff --git a/Tests/Factory/TyphoonComponentFactoryTests.m b/Tests/Factory/TyphoonComponentFactoryTests.m index bda71f050..b401309e2 100644 --- a/Tests/Factory/TyphoonComponentFactoryTests.m +++ b/Tests/Factory/TyphoonComponentFactoryTests.m @@ -17,6 +17,7 @@ #import "CavalryMan.h" #import "Champion.h" #import "AutoWiringKnight.h" +#import "Harlot.h" static NSString* const DEFAULT_QUEST = @"quest"; @@ -132,6 +133,16 @@ - (void)test_objectForType { assertThat([e description], equalTo(@"No components defined which satisify type: 'Champion'")); } + + @try + { + id harlot = [_componentFactory componentForType:@protocol(Harlot)]; + STFail(@"Should have thrown exception"); + } + @catch (NSException* e) + { + assertThat([e description], equalTo(@"No components defined which satisify type: 'id'")); + } } - (void)test_objectForKey_returns_singleton_with_property_dependencies_resolved_by_type diff --git a/Tests/Harlot.h b/Tests/Harlot.h new file mode 100644 index 000000000..8f22b6db7 --- /dev/null +++ b/Tests/Harlot.h @@ -0,0 +1,15 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// MOD PRODUCTIONS +// Copyright 2013 Mod Productions +// All Rights Reserved. +// +// NOTICE: Mod Productions permit you to use, modify, and distribute this file +// in accordance with the terms of the license agreement accompanying it. +// +//////////////////////////////////////////////////////////////////////////////// + +#import + +@protocol Harlot +@end \ No newline at end of file diff --git a/Typhoon.xcodeproj/project.pbxproj b/Typhoon.xcodeproj/project.pbxproj index 889227f0f..6ff622085 100644 --- a/Typhoon.xcodeproj/project.pbxproj +++ b/Typhoon.xcodeproj/project.pbxproj @@ -119,6 +119,7 @@ BA798B0E98DACFF7F724848B /* CircularDependenciesAssembly.m in Sources */ = {isa = PBXBuildFile; fileRef = BA798718B12F783930A46333 /* CircularDependenciesAssembly.m */; }; BA798B291EDCA2E25701D626 /* TyphoonDefinition.h in Headers */ = {isa = PBXBuildFile; fileRef = BA798CA3A88193EC0242E6EC /* TyphoonDefinition.h */; }; BA798B82BE8C9399E0DAC53C /* TyphoonParameterInjectedByValue.m in Sources */ = {isa = PBXBuildFile; fileRef = BA7987099DAD3FC6A242E863 /* TyphoonParameterInjectedByValue.m */; }; + BA798B8C40CBB04CFA2AC82E /* Harlot.h in Install Hamcrest and Mockito */ = {isa = PBXBuildFile; fileRef = BA798B9A1B9A8AA11D46EF95 /* Harlot.h */; }; BA798BB4D9038A4C5E6B8FFF /* TyphoonTypeConverter.h in Headers */ = {isa = PBXBuildFile; fileRef = BA7983E3C21E67A0ABCEB3C4 /* TyphoonTypeConverter.h */; }; BA798BBAFE0BD0E6B8595BC7 /* Info-iOS.plist in Resources */ = {isa = PBXBuildFile; fileRef = BA798F0C33EBF7B9102B886A /* Info-iOS.plist */; }; BA798BE56FC8C7D40AEC1ECB /* TyphoonPrimitiveTypeConverterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = BA79835B6157EAC72445EC18 /* TyphoonPrimitiveTypeConverterTests.m */; }; @@ -158,6 +159,7 @@ files = ( 6B7CE44516C74919002E0107 /* OCMockito.framework in Install Hamcrest and Mockito */, 6BD2B6E216AC031B0066C5DB /* OCHamcrest.framework in Install Hamcrest and Mockito */, + BA798B8C40CBB04CFA2AC82E /* Harlot.h in Install Hamcrest and Mockito */, ); name = "Install Hamcrest and Mockito"; runOnlyForDeploymentPostprocessing = 0; @@ -259,6 +261,7 @@ BA798AC8A5E199CCE249DBB6 /* TyphoonNSURLTypeConverter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonNSURLTypeConverter.m; sourceTree = ""; }; BA798AF66DE1ED5E61866145 /* Champion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Champion.h; sourceTree = ""; }; BA798B3CB0EE595B87ED5B1C /* TyphoonPropertyInjectedByValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TyphoonPropertyInjectedByValue.h; sourceTree = ""; }; + BA798B9A1B9A8AA11D46EF95 /* Harlot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Harlot.h; sourceTree = ""; }; BA798BC151C9C2FC6B82D48B /* TyphoonDefinition+BlockAssembly.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "TyphoonDefinition+BlockAssembly.m"; sourceTree = ""; }; BA798BD1C3AC7C8500D9191E /* Knight.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Knight.m; sourceTree = ""; }; BA798BDAEB237C52367719BA /* TyphoonJRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TyphoonJRSwizzle.m; sourceTree = ""; }; @@ -373,6 +376,7 @@ BA7985A14209EDAA0D5F322C /* Resources */, BA7983C55C137AC3C4B21455 /* TypeConversion */, BA798CC05964B6ED55F0AE50 /* Utils */, + BA798B9A1B9A8AA11D46EF95 /* Harlot.h */, ); path = Tests; sourceTree = "";