Class: TestLauncher::Queries::PathQuery
Instance Attribute Summary
Attributes inherited from BaseQuery
#request
Instance Method Summary
collapse
Methods inherited from BaseQuery
#initialize
Instance Method Details
#command ⇒ Object
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
# File 'lib/test_launcher/queries.rb', line 193
def command
return if test_cases.empty?
if one_file?
shell.notify "Found #{pluralize(file_count, "file")}."
runner.single_file(test_cases.first)
elsif request.run_all?
shell.notify "Found #{pluralize(file_count, "file")}."
runner.multiple_files(test_cases)
else
shell.notify "Found #{pluralize(file_count, "file")}."
shell.notify "Running most recently edited. Run with '--all' to run all the tests."
runner.single_file(most_recently_edited_test_case)
end
end
|
#files_found_by_path ⇒ Object
215
216
217
|
# File 'lib/test_launcher/queries.rb', line 215
def files_found_by_path
@files_found_by_path ||= searcher.test_files(request.search_string)
end
|
#test_cases ⇒ Object
209
210
211
212
213
|
# File 'lib/test_launcher/queries.rb', line 209
def test_cases
@test_cases ||= files_found_by_path.map { |file_path|
request.test_case(file: file_path, request: request)
}
end
|