Skip to content
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.

Some tests with caveat #11

Closed
wants to merge 5 commits into from
Closed

Some tests with caveat #11

wants to merge 5 commits into from

Conversation

kaiwu
Copy link
Contributor

@kaiwu kaiwu commented Jul 7, 2011

Hi,

I've added a few more tests with caveat:

  • the latest addition of Mutable variants break a few existing tests,
    as you might have noticed, which i don't understand

  • there seems to have no way of verifying weak reference in iOS ?

    [self weaklyAssociateValue:subject withKey:&kAssociationKey];
    #if BK_HAS_APPKIT
    //zeroing weak reference is not available for iOS
    NSString *associated = (NSString *)[self associatedValueForKey:&kAssociationKey];
    GHAssertNil(associated,@"associated value is nil");
    #endif
    
  • for the other BlocksKit category on UIView classes, is there a way to simulate the tap events ?
    i have googled a while and cannot find good solutions, so the test does not really cover the block part yet

@zwaldowski
Copy link
Collaborator

Yeah, I fixed the mutable tests thing. I thought the runtime differentiated selectors by return type... e.g., (NSArray *)select would not be overridden by (void)select. That's not true, and it's fixed. I'll merge this in a few minutes.

As far as simulating taps, I know there's something that Three20 did to unit test, but it's a very very private method.

Additionally, weaklyAssociateValue:withKey: does not use a weak reference on any version of iOS. It's too late to change it now, but it really just associates objects with OBJC_ASSOCIATION_ASSIGN. I'll look into doing a weak reference, though.

@zwaldowski
Copy link
Collaborator

@kaiwu
Copy link
Contributor Author

kaiwu commented Jul 8, 2011

the UI automation looks not very easy ...
i will implement a few basic tests (leaving the block) for the time being

close this pull request and replace this with a new one

@kaiwu kaiwu closed this Jul 8, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants