Sha256: af93ff7ceb434b76bfb1d463733bbd4f38b401bfb5cd2c615cb59d33572489c1

Contents?: true

Size: 1.14 KB

Versions: 3

Compression:

Stored size: 1.14 KB

Contents

module MiniTestSpecRails
  class Railtie < ::Rails::Railtie
    config.minitest_spec_rails = ActiveSupport::OrderedOptions.new
    config.minitest_spec_rails.mini_shoulda = false

    if ENV['RAILS_ENV'] == 'test'
      config.before_initialize do |_app|
        require 'active_support'
        require 'minitest-spec-rails/init/active_support'
        ActiveSupport.on_load(:action_controller) do
          require 'minitest-spec-rails/init/action_controller'
          require 'minitest-spec-rails/init/action_dispatch'
        end
        ActiveSupport.on_load(:action_mailer) do
          require 'minitest-spec-rails/init/action_mailer'
        end
        ActiveSupport.on_load(:active_job) do
          require 'minitest-spec-rails/init/active_job'
        end
      end

      initializer 'minitest-spec-rails.action_view', after: 'action_view.setup_action_pack', group: :all do |_app|
        require 'minitest-spec-rails/init/action_view'
      end

      initializer 'minitest-spec-rails.mini_shoulda', group: :all do |app|
        require 'minitest-spec-rails/init/mini_shoulda' if app.config.minitest_spec_rails.mini_shoulda
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minitest-spec-rails-6.0.1 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-6.0.0 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-5.5.0 lib/minitest-spec-rails/railtie.rb