我在 ruby 1.9.2 之上的 rails 3.1 应用程序中运行以下 gem:
group :test, :development do
gem 'turn', '<0.8.3'
gem 'rspec-rails'
gem 'capybara'
gem 'guard-rspec'
gem 'minitest'
gem 'ruby_gntp'
gem "win32console", "~> 1.3.0"
end
我只通过运行
rails g integration_test MyApp
命令。
所以,我只有一个由命令生成的示例测试。它看起来像这样:
require 'spec_helper'
describe "Tasks" do
describe "GET /tasks" do
it "works! (now write some real specs)" do
# Run the generator again with the --webrat flag if you want to use webrat methods/matchers
get tasks_index_path
response.status.should be(200)
end
end
end
出于某种原因,当我运行警卫时,它需要 3.5 到 5 秒之间的警卫和 rspec 只是在小测试中失败。在我看到的 tuts 中,他们的机器在 Mac 上运行这个精确的测试大约需要 0.0159 秒。我可以做些什么来提高这些测试的性能?
我在 Windows 7 机器上运行它。
有没有人处理过这种情况?