Sha256: 1ba35aa0b68ef9c8f1e89ea8858f2026d13c7fcfda202660ed52ca70231a4f72

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 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_view) do
          require 'minitest-spec-rails/init/action_view'
        end
        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.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

8 entries across 8 versions & 1 rubygems

Version Path
minitest-spec-rails-4.7.7 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.6 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.5 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.4 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.3 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.2 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.1 lib/minitest-spec-rails/railtie.rb
minitest-spec-rails-4.7.0 lib/minitest-spec-rails/railtie.rb