mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
69e5547162
The line filter parsing added to ActiveSupport::TestCase is only half the story to enable line filtering. The other half, of adding the patterns to the options, is done in the Minitest plugin that Railties has. Thus it makes more sense to have the filter in Railties with the other half and all the line filtering tests. Move the filter and extend Active Support in an initializer, so that when users or `rails/all.rb` require `rails/test_unit/railtie` we can still filter by line.
24 lines
612 B
Ruby
24 lines
612 B
Ruby
require 'rails/test_unit/line_filtering'
|
|
|
|
if defined?(Rake.application) && Rake.application.top_level_tasks.grep(/^(default$|test(:|$))/).any?
|
|
ENV['RAILS_ENV'] ||= 'test'
|
|
end
|
|
|
|
module Rails
|
|
class TestUnitRailtie < Rails::Railtie
|
|
config.app_generators do |c|
|
|
c.test_framework :test_unit, fixture: true,
|
|
fixture_replacement: nil
|
|
|
|
c.integration_tool :test_unit
|
|
end
|
|
|
|
initializer "test_unit.line_filtering" do
|
|
ActiveSupport::TestCase.extend Rails::LineFiltering
|
|
end
|
|
|
|
rake_tasks do
|
|
load "rails/test_unit/testing.rake"
|
|
end
|
|
end
|
|
end
|