RBIPhoneTest Oddities?

Of course I don’t expect things to work 100% so it’s no surprise that I found an oddity in the RBIPhoneTest project (brought to you by Dr. Nic). No discredit at all toward Dr. Nic, as he did a fantastic job with what little Apple gives you. Maybe it’s my misunderstanding of Ruby testing and the ZenTest autotest thing but I got autotest running since finishing that screencast last night and I noticed that inserting a simple “assert_respond_to” call started showing a test failure when I thought it should pass. I then found something even funnier. After commenting the failing “assert_respond_to” call the test passed! Yes, that’s not really funny but get this. I uncommented the very same line that was failing and got the test to pass!! Now that’s funny! not in the “haha” sense of funny but more in the “things that make you go hmm…” Arseniol Hall kinda funny. It’s repeatable as well. I change the message name in the responds to assertion to make it fail, change it back to make it right but it still fails, comment the line to make it pass, uncomment and it still passes! More on this later…

4 thoughts on “RBIPhoneTest Oddities?

  1. Hey Dr. Nic! Thanx for the house call! I think I finally did find the root cause and I thought I posted a follow up. In short it has to do with the way Ruby/Cocoa dynamically dispatches methods. The first call ends up in the no-method-found (or doesnotrespondto or whatever that magic Ruby method is that’s called for undefined stuff) catch-all of the Ruby proxy then the RubyCocoa magic adds the method to the class on the fly. I’m not certain that’s the true cause but it kind of makes sense. I’ll post more as I find out. By the way, since you’re here I got this nasty cough that acts up every time I pass an integer from my controller into my model object. It’s the last post on my home page and Robitusson just won’t clear it up. Mind having a look?

  2. You passing natural NSInteger’s or those nasty int blighters?

    Remember to always read the label and contact a doctor if stacktraces and core dumps persist.

  3. Yeah, it’s those nasty int blighties (…or is it blighters?) Is that not good? I mean… can a brotha’ catch the virus when he use ‘dem blightums? I read the label but I ain’t good on the medical terms and all… do my significant other need unit testing too? Break me off somethin’.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s