Sha256: fc84c4f56c3c3b1b43688585730c3fc9649470acb52fce163f4841ba3654030a

Contents?: true

Size: 1.19 KB

Versions: 25

Compression:

Stored size: 1.19 KB

Contents

gem 'minitest'
require 'minitest'
require 'rails/test_unit/minitest_plugin'

task default: :test

desc "Runs all tests in test folder"
task :test do
  $: << "test"
  pattern = if ENV.key?('TEST')
               ENV['TEST']
             else
               "test"
             end
  Minitest.rake_run([pattern])
end

namespace :test do
  task :prepare do
    # Placeholder task for other Railtie and plugins to enhance.
    # If used with Active Record, this task runs before the database schema is synchronized.
  end

  task :run => %w[test]

  desc "Run tests quickly, but also reset db"
  task :db => %w[db:test:prepare test]

  ["models", "helpers", "controllers", "mailers", "integration", "jobs"].each do |name|
    task name => "test:prepare" do
      $: << "test"
      Minitest.rake_run(["test/#{name}"])
    end
  end

  task :generators => "test:prepare" do
    $: << "test"
    Minitest.rake_run(["test/lib/generators"])
  end

  task :units => "test:prepare" do
    $: << "test"
    Minitest.rake_run(["test/models", "test/helpers", "test/unit"])
  end

  task :functionals => "test:prepare" do
    $: << "test"
    Minitest.rake_run(["test/controllers", "test/mailers", "test/functional"])
  end
end

Version data entries

25 entries across 25 versions & 4 rubygems

Version Path
railties-5.0.4 lib/rails/test_unit/testing.rake
railties-5.0.4.rc1 lib/rails/test_unit/testing.rake
railties-5.0.3 lib/rails/test_unit/testing.rake
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/railties-5.0.2/lib/rails/test_unit/testing.rake
railties-5.0.2 lib/rails/test_unit/testing.rake
railties-5.0.2.rc1 lib/rails/test_unit/testing.rake
autocompl-0.2.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.2.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.2.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.1.2 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.1.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.1.0 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
autocompl-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/railties-5.0.1/lib/rails/test_unit/testing.rake
abaci-0.3.0 vendor/bundle/gems/railties-5.0.0/lib/rails/test_unit/testing.rake
railties-5.0.1 lib/rails/test_unit/testing.rake
railties-5.0.1.rc2 lib/rails/test_unit/testing.rake
railties-5.0.1.rc1 lib/rails/test_unit/testing.rake
railties-5.0.0.1 lib/rails/test_unit/testing.rake
railties-5.0.0 lib/rails/test_unit/testing.rake
railties-5.0.0.rc2 lib/rails/test_unit/testing.rake