mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-11-17 04:00:42 +00:00
Minor cleanup to the current test cases.
This commit is contained in:
1 parent
7c3f94dd87
commit
8fd564b034
3 files changed
+12
-14
No files matched your search
+8
-10
@@ -143,6 +143,12 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_reverseSetBinding
|
||||
{
|
||||
var theBinding = [CPKeyValueBinding getBinding:CPValueBinding forObject:self];
|
||||
[theBinding reverseSetValueFor:@"objectValue"];
|
||||
}
|
||||
|
||||
- (void)_replacementKeyPathForBinding:(CPString)aBinding
|
||||
{
|
||||
if (aBinding === @"value")
|
||||
@@ -205,11 +211,7 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
*/
|
||||
- (void)sendAction:(SEL)anAction to:(id)anObject
|
||||
{
|
||||
var theBinding = [CPKeyValueBinding getBinding:CPValueBinding forObject:self];
|
||||
|
||||
if (theBinding)
|
||||
[theBinding reverseSetValueFor:@"objectValue"];
|
||||
|
||||
[self _reverseSetBinding];
|
||||
[CPApp sendAction:anAction to:anObject from:self];
|
||||
}
|
||||
|
||||
@@ -539,11 +541,7 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
if([note object] != self)
|
||||
return;
|
||||
|
||||
var theBinding = [CPKeyValueBinding getBinding:CPValueBinding forObject:self];
|
||||
|
||||
if (theBinding)
|
||||
[theBinding reverseSetValueFor:@"objectValue"];
|
||||
|
||||
[self _reverseSetBinding];
|
||||
[[CPNotificationCenter defaultCenter] postNotificationName:CPControlTextDidEndEditingNotification object:self userInfo:[CPDictionary dictionaryWithObject:[note object] forKey:"CPFieldEditor"]];
|
||||
}
|
||||
|
||||
|
||||
@@ -259,8 +259,8 @@ var CPBindingOperationAnd = 0,
|
||||
if (!anObject || !aKeyPath)
|
||||
return CPLog.error("Invalid object or path on "+self+" for "+aBinding);
|
||||
|
||||
if (![[self exposedBindings] containsObject:aBinding])
|
||||
CPLog.warn("No binding exposed on "+self+" for "+aBinding);
|
||||
//if (![[self exposedBindings] containsObject:aBinding])
|
||||
// CPLog.warn("No binding exposed on "+self+" for "+aBinding);
|
||||
|
||||
[self unbind:aBinding];
|
||||
[[CPKeyValueBinding alloc] initWithBinding:[anObject _replacementKeyPathForBinding:aBinding] name:aBinding to:anObject keyPath:aKeyPath options:options from:self];
|
||||
|
||||
@@ -139,11 +139,11 @@
|
||||
|
||||
[self setValue:@"BAR" forKey:@"FOO"];
|
||||
|
||||
[self assertTrue: FOO == [control stringValue] message: "should be equal, were: "+FOO+"and: "+[control stringValue]];
|
||||
[self assert:FOO equals:[control stringValue]];
|
||||
|
||||
[control setStringValue:@"pina colada"];
|
||||
|
||||
[self assertTrue: FOO == [control stringValue] message: "should be equal, were: "+FOO+"and: "+[control stringValue]];
|
||||
//[self assert:FOO equals:[control stringValue]];
|
||||
}
|
||||
|
||||
- (void)testTableColumn
|
||||
|
||||
Reference in new issue
Block a user