Sha256: 8a9a2f2aa5f36240c34fe839fef1c73337d22a93d726a3694065cbf1ff9f0494

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

# frozen_string_literal: true

require 'rake/testtask'

rspec_loaded = true
begin
  require 'rspec/core/rake_task'
rescue LoadError
  rspec_loaded = false
end

namespace :eac_rails_base0 do
  desc 'Remove all temporary files.'
  task clear: ['db:schema:cache:clear', 'log:clear', 'tmp:clear', 'assets:clobber'] do
  end

  if rspec_loaded
    RSpec::Core::RakeTask.new(:rspec) do |t|
      t.rspec_opts =
        "--pattern '{spec,#{EacRailsBase0::Paths.engines_subpath}/*/spec}/**/*_spec.rb'"
    end
    Rake::Task['eac_rails_base0:rspec'].enhance ['db:test:prepare']
  end

  namespace :minitest do
    { core: '', engines: "#{EacRailsBase0::Paths.engines_subpath}/*/" }
      .each do |name, pattern_prefix|
      Rake::TestTask.new(name => 'test:prepare') do |t|
        t.libs << 'test'
        t.pattern = "#{pattern_prefix}test/**/*_test.rb"
        t.ruby_opts = %w[-W0]
        t.verbose = false
      end
    end
  end

  desc 'Minitest for application and engines'
  task minitest: %w[core engines].map { |task| "eac_rails_base0:minitest:#{task}" }

  desc 'Minitest and RSpec for application'
  task test: ['eac_rails_base0:minitest'] + (rspec_loaded ? ['eac_rails_base0:rspec'] : [])
end

Rake::Task['default'].clear
task default: %w[eac_rails_base0:test]

Rake::Task['test'].clear
task test: %w[eac_rails_base0:minitest]

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eac_rails_base0-0.68.1 lib/tasks/eac_rails_base0.rake