Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/EditingAdditionsWarnings'
Browse files Browse the repository at this point in the history
  • Loading branch information
jspahrsummers committed Apr 10, 2012
2 parents a5d3c27 + 38a5874 commit f2a7131
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Proton/NSUndoManager+EditingAdditions.h
Expand Up @@ -26,7 +26,7 @@
/**
* Invokes <tryEditGroupingWithActionName:> with a `nil` `actionName`.
*/
- (BOOL)tryEditGrouping;
- (BOOL)tryEditGrouping __attribute__((warn_unused_result));

/**
* Attempts to open an edit grouping named `actionName` and immediately
Expand All @@ -36,7 +36,7 @@
* If `actionName` is an empty string, the action name currently associated with the menu
* command is removed. The receiver's action name remains unchanged if this is `nil`.
*/
- (BOOL)tryEditGroupingWithActionName:(NSString *)actionName;
- (BOOL)tryEditGroupingWithActionName:(NSString *)actionName __attribute__((warn_unused_result));

/**
* Invokes <tryEditGroupingWithActionName:usingBlock:> with a `nil`
Expand All @@ -52,7 +52,7 @@
* @param actionName The name of the action associated with undoing the edit grouping.
* If `actionName` is an empty string, the action name currently associated with the menu
* command is removed. The receiver's action name remains unchanged if this is `nil`.
*
*
* @param block The block to execute within the edit grouping.
*/
- (BOOL)tryEditGroupingWithActionName:(NSString *)actionName usingBlock:(void (^)(void))block;
Expand Down
3 changes: 2 additions & 1 deletion ProtonTests/PRONSUndoManagerAdditionsTests.m
Expand Up @@ -457,8 +457,9 @@ - (void)decrementChangeCountWithUndoManager:(NSUndoManager *)undoManager;

it(@"opens an edit grouping with a name", ^{
NSString *expectedName = @"foobar";
[undoManager tryEditGroupingWithActionName:expectedName];
BOOL success = [undoManager tryEditGroupingWithActionName:expectedName];

expect(success).toBeTruthy();
expect(undoManager.undoActionName).toEqual(expectedName);

block();
Expand Down

0 comments on commit f2a7131

Please sign in to comment.