我在使用Rspec和我的Rails 3.2.11应用程序。我已经安装并设置spork。 我使用数据映射器作为ORM。Rspec加载太长时间
然而,当spork运行时,运行单个测试需要一分多钟。 即使正在运行的测试为空。有些东西肯定是错的。但我不能确切地指出 。
我test_spec是这样的:
require "spec_helper"
require "cancan/matchers"
describe User do
end
我的天赋帮助文件可以在这里找到:https://gist.github.com/4593609
当我一次RSpec的:
➜ books git:(dev) ✗ time rspec --drb spec/models/test_spec.rb
No examples found.
Finished in 1 minute 51.08 seconds
0 examples, 0 failures
rspec --drb spec/models/test_spec.rb 1.49s user 0.04s system 1% cpu 1:52.94 total
叉勺登录:
➜ books git:(dev) ✗ spork
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Rack::File headers parameter replaces cache_control after Rack 1.5.
Spork is ready and listening on 8989!
Running tests with args ["spec/models/test_spec.rb"]...
Done.
Running tests with args ["spec/models/test_spec.rb"]...
Done.
这是一个空的规范。有很多例子的规格需要更多时间。 什么可以采取这么长时间才能运行?
你连接到远程数据库吗?数据库表是否有太多列?我认为你的情况都是如此:P – piyush