Sha256: 57e584064167fa825235c1104d1d541614ccfb426749db4b9dae05ca9974b2a5

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

    config.before_initialize do |app|
      if Rails.env.test?
        ActiveSupport.on_load(:action_controller) do
          require 'minitest-spec-rails/init/action_controller'
          require 'action_dispatch/testing/integration' # For Rails 3.0 loading.
          require 'minitest-spec-rails/init/action_dispatch'
        end
        ActiveSupport.on_load(:action_mailer) do
          require 'minitest-spec-rails/init/action_mailer'
        end
      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 if Rails.env.test?

    initializer 'minitest-spec-rails.after.load_active_support', :after => :load_active_support, :group => :all do |app|
      if Rails.env.test?
        require 'minitest-spec-rails/init/mini_shoulda' if app.config.minitest_spec_rails.mini_shoulda
        require 'minitest/autorun'
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
minitest-spec-rails-4.7.10 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.9 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.8 lib/minitest-spec-rails/railtie.rb