Class: Rails::TestTask::TestInfo
- Inherits:
-
Object
- Object
- Rails::TestTask::TestInfo
- Defined in:
- lib/rails/test_unit/sub_test_task.rb
Instance Method Summary collapse
- #files ⇒ Object
-
#initialize(tasks) ⇒ TestInfo
constructor
A new instance of TestInfo.
- #opts ⇒ Object
- #tasks ⇒ Object
- #translate(file) ⇒ Object
Constructor Details
#initialize(tasks) ⇒ TestInfo
Returns a new instance of TestInfo.
6 7 8 |
# File 'lib/rails/test_unit/sub_test_task.rb', line 6 def initialize(tasks) @tasks = tasks end |
Instance Method Details
#files ⇒ Object
10 11 12 13 14 |
# File 'lib/rails/test_unit/sub_test_task.rb', line 10 def files @tasks.map { |task| [task, translate(task)].find { |file| test_file?(file) } }.compact end |
#opts ⇒ Object
28 29 30 31 32 33 |
# File 'lib/rails/test_unit/sub_test_task.rb', line 28 def opts opts = opt_names if opts.any? "-n #{opts.join ' '}" end end |
#tasks ⇒ Object
24 25 26 |
# File 'lib/rails/test_unit/sub_test_task.rb', line 24 def tasks @tasks - test_file_tasks - opt_names end |
#translate(file) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/rails/test_unit/sub_test_task.rb', line 16 def translate(file) if file =~ /^app\/(.*)$/ "test/#{$1.sub(/\.rb$/, '')}_test.rb" else "test/#{file}_test.rb" end end |