Test::Unit - Ruby Unit Testing Framework Questions

Discussion in 'Ruby' started by Bill Mosteller, Oct 22, 2009.

  1. 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
    | Eloqua www.eloqua.com | 1921 Gallows Road,
    Suite 250, Vienna, VA 22182
    --
    Posted via http://www.ruby-forum.com/.
     
    Bill Mosteller, Oct 22, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Edvard Majakari
    Replies:
    4
    Views:
    686
    Edvard Majakari
    Feb 25, 2005
  2. VvanN
    Replies:
    5
    Views:
    488
    Phlip
    Apr 28, 2006
  3. Piergiuliano Bossi
    Replies:
    0
    Views:
    104
    Piergiuliano Bossi
    Feb 16, 2004
  4. Chintakrindi Meghanath

    Ruby Unit Testing Framework

    Chintakrindi Meghanath, Nov 1, 2005, in forum: Ruby
    Replies:
    3
    Views:
    122
    obscured by code
    Nov 1, 2005
  5. timr
    Replies:
    2
    Views:
    165
Loading...

Share This Page