>rails -v
Rails 1.2.6
>ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
このようなテスト フィクスチャ (Rails モデル クラスをテストする) を実行すると、これらのテストの実行を開始するのに 20 ~ 30 秒かかります ("Loaded suite..." が表示されます)。何を与える?
>ruby test\unit\category_test.rb
require File.dirname(__FILE__) + '/../test_helper'
class CategoryTest < Test::Unit::TestCase
def setup
Category.delete_all
end
def test_create
obCategoryEntry = Category.new({:name=>'Apparel'})
assert obCategoryEntry.save, obCategoryEntry.errors.full_messages.join(', ')
assert_equal 1, Category.count
assert_not_nil Category.find(:all, :conditions=>"name='Apparel'")
end
#.. 1 more test here
end
これは、フィクスチャのない MySql DB を使用する Rails です。今回は、起動までに 30 秒以上かかりました。