I’m having a strange issue with test/unit. I want to use the at_start
method, which is not available in the version that comes bundled with
ruby. So I installed the 2.5.5 version with “gem install test-unit”.
Here’s how I use it:
gem ‘test-unit’, ‘=2.5.5’
puts “In start block”
class CouponTest < Test::Unit::TestCase
This runs OK when I run it directly with ruby, but when I run it with
rake it appears to load the old version of test/unit and so fails with
NoMethodError on at_start. This happens even when I load the gem in the
rakefile. Here’s my rakefile code:
Rake::TestTask.new(‘integration’) do |t|
ENV[‘RACK_ENV’] = ‘test’
t.libs << “app”
t.pattern = “app/tests/test*test.rb”
So my questions are:
- How can I make this work when I run it from the rakefile?
- Is there nay way to load the new version of test/unit without
resorting to “gem ‘test-unit’”?