how to run rake task for multiple rspec file

1.create a rake file first

require 'rake'
require 'rspec/core/rake_task'

desc 'Default: run specs.'
task default: :spec

desc 'Run specs'
RSpec::Core::RakeTask.new(:multiple_test) do |t|
  t.pattern = [
    'spec/controllers/api/v1/aa.rb',
    'spec/controllers/products/bb.rb',
    'spec/jobs/prodicuts/cc.rb',
    'spec/services/users/dd.rb',
  ]
end

2.run rake multiple_test

comments powered by Disqus