As you already know that, to develop an application we need to use always some test framework.
Actually following two keywords are very common.
- BDD (Behavior Driven Development)
- TDD (Test Driven Development)
In a project, I am using Kiwi framework to do unit test.
Today I found a weird behavior from Kiwi.
Let's see this code.
With this code you will get this log message :
2013-05-22 22:45:11.179 MyKiwiTest[70475:c07] (null)
What's wrong with it? I just set the expectation, and then this selector was not called....;(
It seems like to have a bug.
But, let's change the position of expectation like this
Finally you get this log message :
2013-05-22 22:46:23.981 MyKiwiTest[77556:c07] I'm speaking to YOU!!
I couldn't find the right reason, but there is a key to find the reason.
in KWExample interface has this selector :
- (void)visitItNode:(KWItNode *)aNode;
And I think, the running cycle of this selector causes this problem.
Anyhow you can face some problem with Unit test because of this situation.
And this way is just a kind of tipp to perform the selector.
Therefore, please be careful to write test codes.
!!! It was not a Bug !!!
If you prevent this kind of error, just call 'andReturn:@YES' .
[[myObj should] receive:@selector(speak:) andReturn:@YES];
Then you will not face this problem anymore!! :D
'programming' 카테고리의 다른 글
|CocoaPods Error with XCode6 (0)||2014.11.05|
|Git Log : print merge tree (0)||2013.11.09|
|[It's not But!! update 2013.08.09] KIWI (BDD/TDD Framework) seems like to have a bug (3)||2013.05.23|
|iOS Development : ivar and property declaration and binding (iOS 개발 ivar와 property 선언 그리고 binding) (0)||2012.01.20|
|Apple은 알고 있지만, 나는 모르는 점. (1)||2009.12.07|
|Windows Mobile Today Plugin 만들기. (0)||2009.08.10|
박상건 - gunnih
베를린에서 일하는 외국인 노동자 » Contact Me: firstname.lastname@example.org