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 8171433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:27:35+00:00 2026-06-06T21:27:35+00:00

I’m moving my tests to the new ruby minitest library, and I am looking

  • 0

I’m moving my tests to the new ruby minitest library, and I am looking for the class that corresponds to the old Test::Unit::TestSuite class. All the examples I’ve found online show single test cases, but I’ve got:

require 'minitest/unit/testsuite'
require 'minitest/unit/ui/console/testrunner'

require 'tests/fs_session_test'
require 'tests/resource_test'
require 'tests/rest_session_test'
require 'tests/server_test'

class AllTests
  def self.suite
    suite = Test::Unit::TestSuite.new
    suite << FSSessionTest.suite
    suite << ResourceTest.suite
    suite << RESTSessionTest.suite
    suite << ServerTest.suite
  end
end

Test::Unit::UI::Console::TestRunner.run(AllTests)

and I keep getting a LoadError on the testsuite require.

  • 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-06T21:27:36+00:00Added an answer on June 6, 2026 at 9:27 pm

    There is no Test::Unit::TestSuite in minitest. You have several options, assuming your tests look something like this:

    require 'minitest/unit'
    require 'minitest/autorun'
    
    class FSSessionTest < MiniTest::Unit::TestCase
      def test_the_truth
        assert true
      end
    end
    

    The vital part here is require 'minitest/autorun' which uses at_exit to run all tests it can find, just before the enclosing script exits. I find this to be the easiest way for running my test suites.

    Run tests with Rake

    For example, you can create a Rakefile using Rake::TestTask which runs all the tests in your test/ directory:

    require 'rake'
    require 'rake/testtask'
    
    Rake::TestTask.new do |t|
      t.pattern = 'tests/**/*_test.rb'
    end
    

    Run the tests with

    $ rake test
    

    Require tests in a Ruby file

    If you frequently only need certain tests, you can also write a test script, something like

    require './tests/fs_session_test'
    require './tests/resource_test'
    require './tests/rest_session_test'
    require './tests/server_test'
    

    You could also include require 'minitest/autorun' at the top of this file to ensure, the tests are run, but i do this at the top of every test file, anyway. Run the suite with

    $ ruby test.rb
    

    Result

    Both methods give you the same output, for example something like

    Run options: --seed 5559
    
    # Running tests:
    
    ....
    
    Finished tests in 0.001909s, 2095.3379 tests/s, 2095.3379 assertions/s.
    
    4 tests, 4 assertions, 0 failures, 0 errors, 0 skips
    

    Because mintiest makes use of at_exit, there is really no need to group the tests before you run them. You never get the output of only one test. Unless, of course you run a test on its own, for example with

    $ ruby tests/fs_session_test.rb 
    Run options: --seed 43007
    
    # Running tests:
    
    .
    
    Finished tests in 0.000672s, 1488.0952 tests/s, 1488.0952 assertions/s.
    
    1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I need a function that will clean a strings' special characters. I do NOT

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.