Вы можете без проблем поместить их в свой каталог юнитов.
Моя библиотека:
[ cpm juno ~/apps/feedback ] cat lib/my_library.rb
class MyLib
def look_at_me
puts "I DO WEIRD STUFF"
end
end
Мой тест:
[ cpm juno ~/apps/feedback ] cat test/unit/fake_test.rb
require 'test_helper'
class FakeTest < ActiveSupport::TestCase
# Replace this with your real tests.
def test_truth
require 'my_library'
puts "RUNNING THIS NOW"
MyLib.new.look_at_me
assert true
end
end
И запустить его:
[ cpm juno ~/apps/feedback ] rake test:units
(in /home/cpm/apps/feedback)
/usr/bin/ruby1.8 -Ilib:test "/usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb" "test/unit/fake_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader
Started
RUNNING THIS NOW
I DO WEIRD STUFF
.
Finished in 0.254404 seconds.
1 tests, 1 assertions, 0 failures, 0 errors
Loaded suite /var/lib/gems/1.8/bin/rake
Started
Finished in 0.00094 seconds.
0 tests, 0 assertions, 0 failures, 0 errors
Пока он заканчивается на _test.rb, он должен его забрать.