Unexpected behaviour when trying to touch something which doesn't exist

16 views
Skip to first unread message

Matthew Flint

unread,
Apr 2, 2011, 5:31:42 PM4/2/11
to UISpec
Hey,

I have a tab-bar app, where there is no "Third" tab. If I do this:

[[app.tabBarButton.label text:@"Third"] should].exist;

... then the test fails as expected, so there is a call to
"UILog.onExampleException:". The exception is raised in
"UIQueryExpectation.exist:" (line 18 in SVN revision 82). But if I do
this:

[[app.tabBarButton.label text:@"Third"] touch];

... then the very same exception is raised - but this time it is
dumped to the console and the Xcode debugger halts the thread. If I
choose to run on, then the app is terminated.

What would explain this difference of behaviour?

I wouldn't expect to have to check "exist" explicitly before calling
"touch" each time.

Thanks!
Matthew

Pete Hodgson

unread,
Apr 2, 2011, 5:41:23 PM4/2/11
to uis...@googlegroups.com, Matthew Flint
Not sure, but it might be that you're seeing a side-effect of the bug in 4.x iOS running in the simulator where exceptions thrown within an NSInvocation are not catched and instead crash the app.


--
You received this message because you are subscribed to the Google Groups "UISpec" group.
To post to this group, send email to uis...@googlegroups.com.
To unsubscribe from this group, send email to uispec+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/uispec?hl=en.


Reply all
Reply to author
Forward
0 new messages