Skip to content

Instantly share code, notes, and snippets.

@ridiculous
Created January 23, 2023 18:49
Show Gist options
  • Save ridiculous/aef35725a703e557862f19bc77843006 to your computer and use it in GitHub Desktop.
Save ridiculous/aef35725a703e557862f19bc77843006 to your computer and use it in GitHub Desktop.
Rakefile for split up test suite
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Dontspreadit::Application.load_tasks
begin
require 'rspec/core/rake_task'
Rake::Task['default'].clear
RSpec::Core::RakeTask.new(:backend) do |config|
config.name = "Ruby backend"
config.rspec_opts = '-t ~js'
end
RSpec::Core::RakeTask.new(:mobile) do |config|
config.name = "Mobile version of the app"
config.rspec_opts = '-t mobile'
end
RSpec::Core::RakeTask.new(:desktop) do |config|
config.name = "Desktop version of the app"
config.rspec_opts = '-t desktop'
end
task browser: [:mobile, :desktop]
task default: [:backend, :browser]
rescue LoadError
puts 'Failed to load core rake tasks, defaulting to Rails default rake task'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment