Skip to content
Browse files

Prepare v5.1.0

  • Loading branch information...
1 parent 9d3ea24 commit bf3da0a7274f58471d4a6334c9595756eb2a71a3 @groue committed Sep 22, 2012
View
6 src/GRMustache.xcodeproj/project.pbxproj
@@ -789,7 +789,7 @@
56DEC3B1152638E20031E8DC /* GRMustachePublicAPITest.h */,
56DEC3B2152638E20031E8DC /* GRMustachePublicAPITest.m */,
56DEC3BD152639420031E8DC /* v5.0 */,
- 56EB54A9160D8146006A5F57 /* variable_helper */,
+ 56EB54A9160D8146006A5F57 /* v5.1 */,
);
path = Public;
sourceTree = "<group>";
@@ -821,12 +821,12 @@
path = JSONKit;
sourceTree = "<group>";
};
- 56EB54A9160D8146006A5F57 /* variable_helper */ = {
+ 56EB54A9160D8146006A5F57 /* v5.1 */ = {
isa = PBXGroup;
children = (
56EB54AB160D8229006A5F57 /* GRMustacheVariableHelperTest.m */,
);
- path = variable_helper;
+ path = v5.1;
sourceTree = "<group>";
};
/* End PBXGroup section */
View
2 src/bin/buildGRMustacheAvailabilityMacros
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
MAJOR_VERSION = 5
-MAX_MINOR_VERSION = 0
+MAX_MINOR_VERSION = 1
puts <<-LICENSE
// The MIT License
View
1 src/classes/GRMustache.h
@@ -96,7 +96,6 @@ typedef struct {
#import "GRMustacheTemplateDelegate.h"
#import "GRMustacheTemplateRepository.h"
#import "GRMustacheFilter.h"
-#import "GRMustacheHelper.h" // deprecated
#import "GRMustacheVariable.h"
#import "GRMustacheVariableHelper.h"
#import "GRMustacheSectionHelper.h"
View
58 src/classes/GRMustacheAvailabilityMacros.h
@@ -29,17 +29,18 @@
* Set up standard GRMustache versions
*/
#define GRMUSTACHE_VERSION_5_0 5000
+#define GRMUSTACHE_VERSION_5_1 5010
/*
- * If max GRMustacheVersion not specified, assume 5.0
+ * If max GRMustacheVersion not specified, assume 5.1
*/
#ifndef GRMUSTACHE_VERSION_MAX_ALLOWED
-#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_0
+#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_1
#endif
/*
@@ -91,3 +92,56 @@
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER
+ *
+ * Used on declarations introduced in GRMustache 5.1
+ */
+#if GRMUSTACHE_VERSION_MAX_ALLOWED < GRMUSTACHE_VERSION_5_1
+#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER UNAVAILABLE_ATTRIBUTE
+#elif GRMUSTACHE_VERSION_MIN_REQUIRED < GRMUSTACHE_VERSION_5_1
+#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED
+ *
+ * Used on declarations introduced in GRMustache 5.1,
+ * and deprecated in GRMustache 5.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_1
+#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER_BUT_DEPRECATED AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER
+#endif
+
+/*
+ * AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1
+ *
+ * Used on declarations introduced in GRMustache 5.0,
+ * but later deprecated in GRMustache 5.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_1
+#define AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1 DEPRECATED_ATTRIBUTE
+#else
+#define AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1 AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER
+#endif
+
+/*
+ * DEPRECATED_IN_GRMUSTACHE_VERSION_5_1_AND_LATER
+ *
+ * Used on types deprecated in GRMustache 5.1
+ */
+#if GRMUSTACHE_VERSION_MIN_REQUIRED >= GRMUSTACHE_VERSION_5_1
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_5_1_AND_LATER DEPRECATED_ATTRIBUTE
+#else
+#define DEPRECATED_IN_GRMUSTACHE_VERSION_5_1_AND_LATER
+#endif
+
+
+
+
+
+
View
24 src/classes/GRMustacheError.h
@@ -55,17 +55,25 @@ extern NSString* const GRMustacheErrorDomain AVAILABLE_GRMUSTACHE_VERSION_5_0_AN
/**
- * TODO
+ * The name of exceptions raised by GRMustache when rendering a template,
+ * whenever:
+ *
+ * - a filter is missing.
+ * - an object expected to conform to the <GRMustacheFilter> protocol does not.
+ * - a GRMustacheDynamicPartial instance can't be rendered because the partial
+ * template is missing.
+ *
+ * @see GRMustacheFilter protocol
+ * @see GRMustacheDynamicPartial
+ *
+ * @since v5.1
*/
-extern NSString * const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER;
+extern NSString * const GRMustacheRenderingException AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER;
/**
- * TODO: deprecate
- * The name of exceptions raised by GRMustache whenever a filter is missing, or
- * the object expected to conform to the <GRMustacheFilter> protocol does not.
- *
- * @see GRMustacheFilter protocol
+ * Deprecated. Use GRMustacheRenderingException instead.
*
* @since v4.3
+ * @deprecated v5.1
*/
-extern NSString * GRMustacheFilterException AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED;
+extern NSString * GRMustacheFilterException AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1;
View
3 src/classes/GRMustacheHelper.h
@@ -20,5 +20,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-// Deprecated header
+#warning GRMustacheHelper.h is deprecated
+
#import "GRMustacheSectionHelper.h"
View
3 src/classes/GRMustacheSectionElement.m
@@ -49,7 +49,6 @@ + (id)sectionElementWithExpression:(GRMustacheExpression *)expression templateRe
- (void)dealloc
{
[_expression release];
- [_templateRepository release];
[_templateString release];
[_elems release];
[super dealloc];
@@ -159,7 +158,7 @@ - (id)initWithExpression:(GRMustacheExpression *)expression templateRepository:(
self = [self init];
if (self) {
_expression = [expression retain];
- _templateRepository = [templateRepository retain]; // TODO: check if we have introduced a retain cycle here
+ _templateRepository = templateRepository; // do not retain, since self is retained by a template, that is retained by the template repository.
_templateString = [templateString retain];
_innerRange = innerRange;
_inverted = inverted;
View
24 src/classes/GRMustacheSectionHelper.h
@@ -59,7 +59,7 @@
*
* @since v2.0
*/
-- (NSString *)renderSection:(GRMustacheSection *)section AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER;
+- (NSString *)renderSection:(GRMustacheSection *)section AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER;
@end
@@ -92,18 +92,34 @@
*
* @since v2.0
*/
-+ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER;
++ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER;
@end
// =============================================================================
#pragma mark - Compatibility layer
-// TODO: mark as deprecated
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+/**
+ * Deprecated. Use GRMustacheSectionHelper instead.
+ *
+ * @since v1.9
+ * @deprecated v5.1
+ */
+AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1
@protocol GRMustacheHelper <GRMustacheSectionHelper>
@end
+#pragma clang diagnostic pop
-// TODO: mark as deprecated
+/**
+ * Deprecated. Use GRMustacheSectionHelper instead.
+ *
+ * @since v2.0
+ * @deprecated v5.1
+ */
+AVAILABLE_GRMUSTACHE_VERSION_5_0_AND_LATER_BUT_DEPRECATED_IN_GRMUSTACHE_VERSION_5_1
@interface GRMustacheHelper: GRMustacheSectionHelper
++ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block;
@end
View
13 src/classes/GRMustacheSectionHelper.m
@@ -94,3 +94,16 @@ - (NSString *)renderSection:(GRMustacheSection *)section
}
@end
+
+
+// =============================================================================
+#pragma mark - GRMustacheHelper
+
+@implementation GRMustacheHelper
+
++ (id)helperWithBlock:(NSString *(^)(GRMustacheSection* section))block
+{
+ return [GRMustacheSectionHelper helperWithBlock:block];
+}
+
+@end
View
39 src/classes/GRMustacheVariable.h
@@ -26,7 +26,17 @@
@class GRMustacheTemplateRepository;
/**
- * TODO
+ * A GRMustacheVariable represents a Mustache variable such as `{{name}}`.
+ *
+ * You will be provided with GRMustacheVariable objects when implementing
+ * mustache lambda sections with objects conforming to the
+ * GRMustacheVariableHelper protocol.
+ *
+ * **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/helpers.md
+ *
+ * @see GRMustacheVariableHelper
+ *
+ * @since v5.1
*/
@interface GRMustacheVariable : NSObject {
@private
@@ -35,13 +45,32 @@
}
/**
- * TODO
+ * Renders a template string with the current rendering context.
+ *
+ * @param string A template string
+ * @param outError If there is an error loading or parsing template and
+ * partials, upon return contains an NSError object that
+ * describes the problem.
+ *
+ * @return A string containing the rendering of the template string.
+ *
+ * @since v5.1
*/
-- (NSString *)renderTemplateString:(NSString *)string error:(NSError **)outError;
+- (NSString *)renderTemplateString:(NSString *)string error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER;
+
/**
- * TODO
+ * Renders a partial template with the current rendering context.
+ *
+ * @param name The name of the partial template.
+ * @param outError If there is an error loading or parsing template and
+ * partials, upon return contains an NSError object that
+ * describes the problem.
+ *
+ * @return A string containing the rendering of the partial template.
+ *
+ * @since v5.1
*/
-- (NSString *)renderTemplateNamed:(NSString *)name error:(NSError **)outError;
+- (NSString *)renderTemplateNamed:(NSString *)name error:(NSError **)outError AVAILABLE_GRMUSTACHE_VERSION_5_1_AND_LATER;
@end
View
2 src/classes/GRMustacheVariable.m
@@ -47,7 +47,7 @@ - (id)initWithTemplateRepository:(GRMustacheTemplateRepository *)templateReposit
{
self = [super init];
if (self) {
- _templateRepository = [templateRepository retain]; // TODO: check if we have introduced a retain cycle here
+ _templateRepository = [templateRepository retain];
_runtime = [runtime retain];
}
return self;
View
3 src/classes/GRMustacheVariableElement.m
@@ -45,7 +45,6 @@ + (id)variableElementWithExpression:(GRMustacheExpression *)expression templateR
- (void)dealloc
{
[_expression release];
- [_templateRepository release];
[_enumerableSectionElement release];
[super dealloc];
}
@@ -115,7 +114,7 @@ - (id)initWithExpression:(GRMustacheExpression *)expression templateRepository:(
{
self = [self init];
if (self) {
- _templateRepository = [templateRepository retain]; // TODO: check if we have introduced a retain cycle here
+ _templateRepository = templateRepository; // do not retain, since self is retained by a template, that is retained by the template repository.
_expression = [expression retain];
_raw = raw;
}
View
22 src/classes/GRMustacheVariableHelper.h
@@ -41,7 +41,7 @@
*
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/helpers.md
*
- * @since TODO
+ * @since v5.1
*/
@protocol GRMustacheVariableHelper<NSObject>
@required
@@ -57,7 +57,7 @@
*
* @return The rendering of the variable
*
- * @since TODO
+ * @since v5.1
*/
- (NSString *)renderVariable:(GRMustacheVariable *)variable;
@end
@@ -75,7 +75,7 @@
*
* @see GRMustacheVariableHelper protocol
*
- * @since TODO
+ * @since v5.1
*/
@interface GRMustacheVariableHelper: NSObject<GRMustacheVariableHelper>
@@ -91,7 +91,7 @@
*
* @return a GRMustacheVariableHelper object.
*
- * @since TODO
+ * @since v5.1
*/
+ (id)helperWithBlock:(NSString *(^)(GRMustacheVariable* variable))block;
@@ -102,13 +102,14 @@
#pragma mark - GRMustacheDynamicPartial
/**
- * TODO
+ * The GRMustacheDynamicPartial is a specific kind of GRMustacheVariableHelper
+ * that, given a partial template name, renders this template.
*
* **Companion guide:** https://github.com/groue/GRMustache/blob/master/Guides/helpers.md
*
* @see GRMustacheVariableHelper protocol
*
- * @since TODO
+ * @since v5.1
*/
@interface GRMustacheDynamicPartial: NSObject<GRMustacheVariableHelper> {
NSString *_name;
@@ -119,9 +120,14 @@
////////////////////////////////////////////////////////////////////////////////
/**
- * TODO
+ * Returns a GRMustacheDynamicPartial that renders a partial template named
+ * _name_.
*
- * @since TODO
+ * @param name A template name
+ *
+ * @return a GRMustacheDynamicPartial
+ *
+ * @since v5.1
*/
+ (id)dynamicPartialWithName:(NSString *)name;
View
13 src/classes/GRMustacheVariable_private.h
@@ -40,7 +40,18 @@
- (NSString *)renderTemplateNamed:(NSString *)name error:(NSError **)outError GRMUSTACHE_API_PUBLIC;
/**
- * TODO
+ * Builds and returns a variable suitable for GRMustacheVariableHelper.
+ *
+ * @param templateRepository A Template repository that allows helpers to
+ * render template strings through
+ * renderTemplateString:error: and
+ * renderTemplateNamed:error: methods.
+ * @param runtime A runtime.
+ *
+ * @return A variable.
+ *
+ * @see GRMustacheVariableHelper
+ * @see GRMustacheRuntime
*/
+ (id)variableWithTemplateRepository:(GRMustacheTemplateRepository *)templateRepository runtime:(GRMustacheRuntime *)runtime GRMUSTACHE_API_INTERNAL;
@end
View
4 src/classes/GRMustacheVersion.h
@@ -33,12 +33,12 @@
*
* @since v1.0
*/
-#define GRMUSTACHE_MINOR_VERSION 0
+#define GRMUSTACHE_MINOR_VERSION 1
/**
* The patch-level component of GRMustache version
*
* @since v1.0
*/
-#define GRMUSTACHE_PATCH_VERSION 1
+#define GRMUSTACHE_PATCH_VERSION 0
View
58 src/tests/Public/v5.0/GRMustacheSectionHelperTest.m
@@ -23,10 +23,10 @@
#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_0
#import "GRMustachePublicAPITest.h"
-@interface GRMustacheSectionHelperTest : GRMustachePublicAPITest
+@interface GRMustacheHelperTest : GRMustachePublicAPITest
@end
-@interface GRMustacheStringSectionHelper : NSObject<GRMustacheSectionHelper> {
+@interface GRMustacheStringSectionHelper : NSObject<GRMustacheHelper> {
NSString *_string;
}
@property (nonatomic, copy) NSString *string;
@@ -45,7 +45,7 @@ - (NSString *)renderSection:(GRMustacheSection *)section
}
@end
-@interface GRMustacheRecorderSectionHelper : NSObject<GRMustacheSectionHelper> {
+@interface GRMustacheRecorderSectionHelper : NSObject<GRMustacheHelper> {
NSUInteger _invocationCount;
NSString *_lastInnerTemplateString;
NSString *_lastRenderedContent;
@@ -74,21 +74,21 @@ - (NSString *)renderSection:(GRMustacheSection *)section
}
@end
-@implementation GRMustacheSectionHelperTest
+@implementation GRMustacheHelperTest
- (void)testHelperPerformsRendering
{
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
GRMustacheStringSectionHelper *helper = [[[GRMustacheStringSectionHelper alloc] init] autorelease];
helper.string = @"---";
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
NSString *result = [GRMustacheTemplate renderObject:context fromString:@"{{#helper}}{{/helper}}" error:nil];
STAssertEqualObjects(result, @"---", @"");
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ // [GRMustacheHelper helperWithBlock:]
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return @"---";
}];
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
@@ -102,16 +102,16 @@ - (void)testHelperRenderingIsNotProcessed
// This test is against Mustache spec lambda definition, which render a template string that should be processed.
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
GRMustacheStringSectionHelper *helper = [[[GRMustacheStringSectionHelper alloc] init] autorelease];
helper.string = @"&<>{{foo}}";
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
NSString *result = [GRMustacheTemplate renderObject:context fromString:@"{{#helper}}{{/helper}}" error:nil];
STAssertEqualObjects(result, @"&<>{{foo}}", @"");
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ // [GRMustacheHelper helperWithBlock:]
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return @"&<>{{foo}}";
}];
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
@@ -123,16 +123,16 @@ - (void)testHelperRenderingIsNotProcessed
- (void)testHelperCanRenderNil
{
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
GRMustacheStringSectionHelper *helper = [[[GRMustacheStringSectionHelper alloc] init] autorelease];
helper.string = nil;
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
NSString *result = [GRMustacheTemplate renderObject:context fromString:@"{{#helper}}{{/helper}}" error:nil];
STAssertEqualObjects(result, @"", @"");
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ // [GRMustacheHelper helperWithBlock:]
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return nil;
}];
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
@@ -144,16 +144,16 @@ - (void)testHelperCanRenderNil
- (void)testHelperCanAccessInnerTemplateString
{
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
GRMustacheRecorderSectionHelper *helper = [[[GRMustacheRecorderSectionHelper alloc] init] autorelease];
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
[GRMustacheTemplate renderObject:context fromString:@"{{#helper}}{{subject}}{{/helper}}" error:nil];
STAssertEqualObjects(helper.lastInnerTemplateString, @"{{subject}}", @"");
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
+ // [GRMustacheHelper helperWithBlock:]
__block NSString *lastInnerTemplateString = nil;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
[lastInnerTemplateString release];
lastInnerTemplateString = [section.innerTemplateString retain];
return nil;
@@ -168,7 +168,7 @@ - (void)testHelperCanAccessInnerTemplateString
- (void)testHelperCanAccessRenderedContent
{
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
GRMustacheRecorderSectionHelper *helper = [[[GRMustacheRecorderSectionHelper alloc] init] autorelease];
NSDictionary *context = [NSDictionary dictionaryWithObjectsAndKeys:
helper, @"helper",
@@ -177,9 +177,9 @@ - (void)testHelperCanAccessRenderedContent
STAssertEqualObjects(helper.lastRenderedContent, @"---===---", @"");
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
+ // [GRMustacheHelper helperWithBlock:]
__block NSString *lastRenderedContent = nil;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
[lastRenderedContent release];
lastRenderedContent = [[section render] retain];
return nil;
@@ -196,7 +196,7 @@ - (void)testHelperCanAccessRenderedContent
- (void)testHelperIsNotCalledWhenItDoesntNeedTo
{
{
- // GRMustacheSectionHelper protocol
+ // GRMustacheHelper protocol
{
GRMustacheRecorderSectionHelper *helper = [[[GRMustacheRecorderSectionHelper alloc] init] autorelease];
NSDictionary *context = [NSDictionary dictionaryWithObject:helper forKey:@"helper"];
@@ -223,10 +223,10 @@ - (void)testHelperIsNotCalledWhenItDoesntNeedTo
}
}
{
- // [GRMustacheSectionHelper helperWithBlock:]
+ // [GRMustacheHelper helperWithBlock:]
{
__block NSUInteger invocationCount = 0;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
invocationCount++;
return nil;
}];
@@ -236,7 +236,7 @@ - (void)testHelperIsNotCalledWhenItDoesntNeedTo
}
{
__block NSUInteger invocationCount = 0;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
invocationCount++;
return nil;
}];
@@ -246,7 +246,7 @@ - (void)testHelperIsNotCalledWhenItDoesntNeedTo
}
{
__block NSUInteger invocationCount = 0;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
invocationCount++;
return nil;
}];
@@ -256,7 +256,7 @@ - (void)testHelperIsNotCalledWhenItDoesntNeedTo
}
{
__block NSUInteger invocationCount = 0;
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
invocationCount++;
return nil;
}];
@@ -269,7 +269,7 @@ - (void)testHelperIsNotCalledWhenItDoesntNeedTo
- (void)testHelperCanRenderCurrentContextInDistinctTemplate
{
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return [section renderTemplateString:@"{{subject}}" error:NULL];
}];
NSDictionary *context = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -281,7 +281,7 @@ - (void)testHelperCanRenderCurrentContextInDistinctTemplate
- (void)testHelperCanRenderCurrentContextInDistinctTemplateContainingPartial
{
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return [section renderTemplateString:@"{{>partial}}" error:NULL];
}];
NSDictionary *context = @{@"helper": helper};
@@ -294,7 +294,7 @@ - (void)testHelperCanRenderCurrentContextInDistinctTemplateContainingPartial
- (void)testTemplateDelegateCallbacksAreCalledWithinSectionRendering
{
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return [section render];
}];
@@ -316,7 +316,7 @@ - (void)testTemplateDelegateCallbacksAreCalledWithinSectionRendering
- (void)testTemplateDelegateCallbacksAreCalledWithinSectionAlternateTemplateStringRendering
{
- id helper = [GRMustacheSectionHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
+ id helper = [GRMustacheHelper helperWithBlock:^NSString *(GRMustacheSection *section) {
return [section renderTemplateString:@"{{subject}}" error:NULL];
}];
View
2 ...ble_helper/GRMustacheVariableHelperTest.m → ...ublic/v5.1/GRMustacheVariableHelperTest.m
@@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-// TODO #define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_0
+#define GRMUSTACHE_VERSION_MAX_ALLOWED GRMUSTACHE_VERSION_5_1
#import "GRMustachePublicAPITest.h"
@interface GRMustacheVariableHelperTest : GRMustachePublicAPITest

0 comments on commit bf3da0a

Please sign in to comment.
Something went wrong with that request. Please try again.