mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-12-01 10:52:03 +00:00
Adding support for CPURL
This commit is contained in:
1 parent
f85ab24993
commit
fc545ed995
2 files changed
+23
-7
No files matched your search
+6
-2
@@ -54,7 +54,9 @@ CPURLCustomIconKey = @"CPURLCustomIconKey";
|
||||
|
||||
+ (id)alloc
|
||||
{
|
||||
return new CFURL();
|
||||
var result = new CFURL();
|
||||
result.isa = [self class];
|
||||
return result;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
@@ -81,7 +83,9 @@ CPURLCustomIconKey = @"CPURLCustomIconKey";
|
||||
|
||||
- (id)initWithString:(CPString)URLString relativeToURL:(CPURL)aBaseURL
|
||||
{
|
||||
return new CFURL(URLString, aBaseURL);
|
||||
var result = new CFURL(URLString, aBaseURL);
|
||||
result.isa = [self class];
|
||||
return result;
|
||||
}
|
||||
|
||||
+ (id)URLWithString:(CPString)URLString relativeToURL:(CPURL)aBaseURL
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
@import "../../Foundation/CPNumber.j"
|
||||
@import "../../Foundation/CPArray.j"
|
||||
@import "../../Foundation/CPDate.j"
|
||||
@import "../../Foundation/CPData.j"
|
||||
|
||||
@implementation SubclassTollFreeTest : OJTestCase
|
||||
|
||||
- (void)testThatSubclassTollFreeDoesAllowForSubclassingDictionary
|
||||
@@ -58,6 +53,14 @@
|
||||
[OJAssert assert:@"b" equals:[target rawString]];
|
||||
}
|
||||
|
||||
- (void)testThatSubclassTollFreeDoesAllowForSubclassingURL
|
||||
{
|
||||
var target = [[MyURL alloc] initWithString:@"http://www.google.com"];
|
||||
[OJAssert assert:@"a" equals:[target newMessage]];
|
||||
[OJAssert assert:@"http://www.google.com" equals:[target absoluteString]];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@import <Foundation/CPDictionary.j>
|
||||
@@ -124,3 +127,12 @@
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation MyURL : CPURL
|
||||
|
||||
- (id)newMessage
|
||||
{
|
||||
return "a";
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user