Testing environment in Rhomobile Eclipse

13 views
Skip to first unread message

mansi desai

unread,
Feb 10, 2012, 10:38:39 AM2/10/12
to rhomobile
I read about this problem before but there was no solution to it. So,
I thought of posting it back.
Is there a way I can have unit tests in my rhomobile application being
developed on eclipse.
I saw the *_spec.rb files in the project>app>test folder but am not
being able to run the tests.

Thanks,
Mansi

Rob Roberts

unread,
Feb 11, 2012, 11:21:31 AM2/11/12
to rhomobile
The tests run in the device simulator, not in Eclipse. (If there's a
way to run them in Eclipse, I'm not aware of it.) Add a link
somewhere in your app to app/SpecRunner. Then the tests run when you
select that link. If there are any test failures, you can see the
details in the log. Use System.getProperty("is_emulator") to make the
link appear only when run in the simulator, and to be hidden when run
on the actual device. I think I I remember reading somewhere in the
Rhodes docs that the mspec test code is excluded from the build when
doing a production build for the device, although I can't confirm
that. (Does anyone know if that is correct?)

--Rob Roberts
Reply all
Reply to author
Forward
0 new messages