alex fenton wrote:> Happy new year to everyone. Has anyone got any ideas forunit-testing
> WxRuby apps. I''m thinking of things like "Simulate click this
menu item;
> choose file "/path/to/file" in Dialog; click OK; assert -
something
> added to this ComboBox..;"
I spent a day or two last summer trying to create "headless" unit
tests
for wxRuby code (where nothing would be displayed on the screen). I was
unable to get that working, so I think any tests will actually have to
create the app and main window, and display them. You might be able to
bring them up off-screen for better speed and less eyestrain.
Beyond that, I think you should be able to do most of what you want
simply by calling into the API. Have you already tried it and run into
problems? Or are you thinking of heading toward a higher-level meta
scripting language that could drive wxRuby widgets generically?
When unit testing a gui, most folks trust that a click on a button will,
in fact, activate the button (as long as it is not disabled, etc.)
Generally the desire it to execute the button click handler and then
make sure it did what it was supposed to do.
Feel free to ask more specific questions, or toss some code up here for
comments.
Cheers,
Kevin