Sha256: 81a563d96ddb05b8254f4d4169915de58b02cf6b7ed0e86081e7d4dabac3110e

Contents?: true

Size: 553 Bytes

Versions: 12

Compression:

Stored size: 553 Bytes

Contents

# frozen_string_literal: true

namespace :factory_bot do
  desc 'Verify that all FactoryBot factories are valid'
  task lint: :environment do
    if Rails.env.test?
      require 'database_cleaner'

      sh 'bundle exec rails db:migrate'
      DatabaseCleaner.clean_with :truncation
      DatabaseCleaner.strategy = :transaction
      DatabaseCleaner.cleaning do
        FactoryBot.lint(traits: true)
      end
    else
      system('bundle exec rake factory_bot:lint RAILS_ENV=test')
      raise if $CHILD_STATUS.exitstatus.nonzero?
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
welaika-suspenders-3.0 templates/factory_bot.rake
welaika-suspenders-2.36 templates/factory_bot.rake
welaika-suspenders-2.35 templates/factory_bot.rake
welaika-suspenders-2.34 templates/factory_bot.rake
welaika-suspenders-2.33 templates/factory_bot.rake
welaika-suspenders-2.32.2 templates/factory_bot.rake
welaika-suspenders-2.32.1 templates/factory_bot.rake
welaika-suspenders-2.32.0 templates/factory_bot.rake
welaika-suspenders-2.31.0 templates/factory_bot.rake
welaika-suspenders-2.30.0 templates/factory_bot.rake
welaika-suspenders-2.29.0 templates/factory_bot.rake
welaika-suspenders-2.29.0.alpha.3 templates/factory_bot.rake