Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Test::Unit - Ruby Unit Testing Framework Questions

Reply
Thread Tools

Test::Unit - Ruby Unit Testing Framework Questions

 
 
Bill Mosteller
Guest
Posts: n/a
 
      10-22-2009
Recently, we collected several (29) Selenium Ruby scripts and put them
into a unit test that runs whenever there’s a build of our product.
That’s been reasonably successful, but our developers would like more.
Specifically, they would like us to include asserts inside of our
scripts.

I see two challenges to this. First, I need guidance on when to code an
assertion. I have some ideas, but like all the open source
documentation I see so far, the emphasis seems to be on syntax rather
than semantics.

Second, I’m a little concerned about inconvenience when I’m debugging an
individual test in the unit test package. The following are real code
examples from my environment.

Run the campaign canvas script under IE:

Today:
driver $ ca
(11 characters)

With Test::Unit:
selenium_tests.rb --name test_create_canvas
(45 characters, and I cannot pick the browser)

Driver.rb invokes the browser of choice ($ in this case, the default is
Firefox if it cannot make out what you asked for), then runs the chosen
script (ca, chosen out of an if/elsif stack with case insensitivity and
matching to the string supplied, even if it’s abbreviated).

With Test::Unit: I lose the ability to pick browser and have to do a
lot more typing to pick a test, and that typing has to be spot on. I
can help the latter problem with some careful re-naming.

I had thought to turn driver into a unit test by surrounding it with the
basic code, but I cannot figure out how to get to the ARGV array once I
do that, so I cannot read the command line.

__________________________________________________ ______________________________________
Bill Mosteller | Test Automation | office: (703) 584-2768
| fax: (703) 584-2751
http://www.velocityreviews.com/forums/(E-Mail Removed) | Eloqua www.eloqua.com | 1921 Gallows Road,
Suite 250, Vienna, VA 22182
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unit-profiling, similar to unit-testing Ulrich Eckhardt Python 6 11-18-2011 02:00 AM
de facto standard C unit testing framework? Peter Michaux C Programming 1 03-21-2008 12:22 AM
Unit testing framework: CxxTest question Anja C++ 3 03-14-2007 03:09 AM
unit--, a unit test framework for C++ VvanN C++ 5 04-28-2006 10:01 AM
Ruby Unit Testing Framework Chintakrindi Meghanath Ruby 3 11-01-2005 10:11 PM



Advertisments