Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8799659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:23:00+00:00 2026-06-14T00:23:00+00:00

I am trying to setup a test suite in Ruby to automate the Testing

  • 0

I am trying to setup a test suite in Ruby to automate the Testing of a WebUI (using Watir)

The individual tests are fine and all run correctly, but I am having problems with the suite.

Eg if one of my tests is (where BaseTestClass extends Test::Unit::TestCase)

class Test3_1_3_1_2 < BaseTestClass
  def testHeightOfMainPanel
    assert(false, 'Not implemented')
  end
end

In my RunAllTests script I am trying to do the following

require 'test/unit'

Test::Unit.at_start do
  #Lets create our own user for these tests
  createCCUser(User, Password)
end

Test::Unit.at_exit do
  #Delete our own user
  deleteUser(User)
end


Dir["./**/Test*.rb"].each{|s|
  puts s.to_s
  load s
}

So basically what I want to do is create a new user at the start of the tests, run the tests and then delete the user. This is necessary because the system is a single sign on (kinda) and if we used the same user for everyone, there is no guarantee that the tests will execute properly (ie someone else could run the test at the same time and then the first user would be kicked out)

The errors I am getting are:
undefined method at_start'
and
private method
at_exit’ called

I know I am doing something wrong, but being very new to Ruby it is hard to see where.
Basically what I need is a way to perform some setup run all the tests that can be found, and then do a cleanup. Each test has its own separate setup and teardown methods

I should also add, I have tried many variations of the same above, eg

require 'test/unit'

class Temp < Test::Unit::TestCase
  Test::Unit.at_exit do
    #Delete our own user
    deleteUser(User)
  end


  Test::Unit.at_start do
    #Lets create our own user for these tests
    createCCUser(User, Password)
  end

  Dir["./**/Test*.rb"].each { |s|
    puts s.to_s
    load s
  }
end

And I still don’t get it. Any help would be appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:23:01+00:00Added an answer on June 14, 2026 at 12:23 am

    I think the problem is, assuming you are using Ruby 1.9.3, is the confusion regarding which gem is being required by require 'test/unit'.

    In Ruby 1.9.3, require 'test/unit' will require the “Minitest” gem. The methods you want to use do not exist in this gem.

    The at_start and at_exit methods exist in the the test-unit gem.

    Assuming you have both the Minitest gem (installed by default in Ruby 1.9) and Test-Unit gem (manually installed using gem install test-unit), you need to specifically state you want the test-unit gem.

    Before requiring test/unit, specify the usage of the test-unit gem:

    gem 'test-unit'
    require 'test/unit'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup a test using NUnit to perform some integration testing of
I'm trying to set up Factory Girl with Test::Unit and Shoulda in Ruby on
I'm trying to build a test framework for automated web testing in Selenium and
I'm trying to setup SSL and Apache on localhost. So far, I follow all
I'm trying to run two Django projects simultaneously. I happened to be using mod_wsgi,
I'm trying to setup a servlet so that users on Android handsets/tablets (using the
I am trying to code a suite test, I have one module which runs
So I am trying to write automation test using Robotium for Android I have
I am trying to get my test suite working and am having some issues.
I'm trying to create automated integration tests for this hardware+software test subject which runs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.