In rails 4.x you used to be able to easily add additional Rails::TestTask
s that would run alongside the core Rails app tests during rake test
. For instance, like this:
http://blog.bigbinary.com/2014/04/26/adding-directory-to-rake-test.html
In Rails 5, none of the approaches I've seen seem to work, and while it seems to be documented/understood around the internet that they no longer work, I haven't seen any mention of the new way to do things.
Anybody know?
It still works but changed in Rails 5.1.3.
Basically rails test runner now picks up everything matching test/**/*_test.rb
except files matching test/system/**/*_test.rb
so you may not have to do anything if your tests are already within test folder.
You can still setup specific test task under test/
like this:
namespace :test do
%w[queries reporters services workers].each do |name|
task name => 'test:prepare' do
$LOAD_PATH << 'test'
Rails::TestUnit::Runner.rake_run(["test/#{name}"])
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With