GJHmf
GJHmf

Reputation: 165

Running a batch of tests in a suite

Back when my test library was running on Watir 2.0.4/Ruby 1.8.7 I was able to use test/unit/testsuite to run a batch of tests in a suite that could run a defined list of test concurrently (see below):

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

require 'foo1.rb' require 'foo2.rb' class Foo def self.suite suite = Test::Unit::TestSuite.new(Foo) suite << foo1.suite suite << foo2.suite return suite end end Test::Unit::UI::Console::TestRunner.run(Foo)<code>

Now I’m using Watir-webdriver on Ruby 1.9.2, this doesn’t seem to work:

C:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': no such file >to load -- test/unit/testsuite (LoadError) from C:/Ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire' from testsuite.rb:6:in <top (required)>' from -e:1:inload' from -e:1:in `'

What are other people doing to string a batch of tests in a suite?

Thanks,

GJHmf

Upvotes: 3

Views: 467

Answers (1)

Justin Ko
Justin Ko

Reputation: 46846

So that this question has an answer, as mentioned in the comments, the problem was that the test-unit gem was not installed.

The test-unit gem used to be included in the default installation of Ruby 1.8.7. In Ruby 1.9, it was replaced by the minitest gem, which is why you now have to manually install it.

To use the same version of test-unit that was in Ruby 1.8.7:

gem install test-unit -v 1.2.3

Or the latest version:

gem install test-unit

Upvotes: 1

Related Questions