【发布时间】:2014-12-06 03:57:04
【问题描述】:
我正在尝试在一个新的 Rails 4 项目中使用 Minitest 设置 Guard。我用以下内容更新了我的 Gemfile:
group :development do
gem 'guard'
gem 'guard-minitest'
end
然后跑bundle exec guard init minitest。
我有一个非常简单的测试,如下所示:
require 'test_helper'
describe ClassToBeTested do
describe "#initialize" do
it "should return a ClassToBeTested object" do
obj = ClassToBeTested.new
obj.must_be_kind_of ClassToBeTested
end
end
end
正在测试的类在app/services/class_to_be_tested.rb。
当我运行 bundle exec guard -n f 时,我得到以下信息:
11:35:43 - INFO - Guard::Minitest 2.3.2 is running, with Minitest::Unit 5.4.1!
11:35:43 - INFO - Running: all tests
Run options: --seed 36837
# Running:
E
Finished in 0.005190s, 192.6728 runs/s, 0.0000 assertions/s.
1) Error:
ClassToBeTested::#initialize#test_0001_should return a ClassToBeTested object:
RuntimeError: You need to configure your Rails::Generators::TestCase destination root.
1 runs, 0 assertions, 0 failures, 1 errors, 0 skips
11:35:45 - INFO - Guard is now watching at '/home/sean/Code/Ruby/work/project'
我有什么遗漏吗? Guard/Minitest/Rails 中的某些东西需要配置才能正常工作?
【问题讨论】:
标签: ruby-on-rails-4 guard minitest