Class: Rails::TestTask::TestCreator
- Inherits:
-
Object
- Object
- Rails::TestTask::TestCreator
- Defined in:
- lib/sub_test_task_patch.rb
Overview
A utility class which is used primarily in “rails/test_unit/testing.rake” to help define rake tasks corresponding to rake test
.
This class takes a TestInfo class and defines the appropriate rake task based on the information, then invokes it.
Instance Method Summary collapse
-
#initialize(info) ⇒ TestCreator
constructor
:nodoc:.
- #invoke_rake_task ⇒ Object
Constructor Details
#initialize(info) ⇒ TestCreator
:nodoc:
14 15 16 |
# File 'lib/sub_test_task_patch.rb', line 14 def initialize(info) @info = info end |
Instance Method Details
#invoke_rake_task ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/sub_test_task_patch.rb', line 18 def invoke_rake_task if @info.files.any? create_and_run_single_test reset_application_tasks else Rake::Task[ENV['TEST'] ? 'test:single' : 'test:run'].invoke end end |