I want to use MiniTest::Spec, I found a couple resources 开发者_运维百科to get started, but none of them mentioned what the test files (or spec files) should be named, and where they should be placed:
test/test_*
spec/*_spec.rb
So which one should I use?
Assuming you are using rake you can specify your own path in the rake file e.g.
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test_*.rb']
t.verbose = true
end
It's up to you obviously, but I'd recommend using spec/**/*_spec.rb
-- the thinking here being, if MiniTest::Spec is modeled after RSpec in syntax, then you might as well put the tests in the same place that RSpec puts them so people won't be put off guard.
精彩评论