开发者

What should MiniTest::Spec files be named?

开发者 https://www.devze.com 2023-02-13 18:33 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消