运行一些测试后,我确信我的设置(windows,rubymine和最新的ruby版本)必须有问题。我现在的时间是:耙测试运行速度很慢
Finished tests in 14.289817s, 0.0700 tests/s, 0.3499 assertions/s.
1 tests, 5 assertions, 0 failures, 0 errors, 0 skips
Process finished with exit code 0
5非常简单的测试(只是检查是否验证空字段工作)。这5次单元测试的总时间为160秒,超过2分钟。
我该怎么做才能提高这个速度?
下面是测试:
require 'test_helper'
class ItemTest < ActiveSupport::TestCase
test 'item attributes must not be empty' do
item = Item.new
assert item.invalid?
assert item.errors[:name].any?
assert item.errors[:description].any?
assert item.errors[:image_url].any?
assert item.errors[:rating].any?
end
end
购买更快的机器?不诚实 - 没有更深的知识你的测试很难说。 – iltempo 2012-08-05 20:26:07
添加了测试 – Organiccat 2012-08-05 20:30:04
现在,我对这种缓慢感到印象深刻。你甚至没有碰到数据库。可能是加载Rails环境需要很长时间。 rake -vT运行多久? – iltempo 2012-08-05 20:32:52