Class: TestLauncher::Queries::SpecifiedNameQuery
Instance Attribute Summary
Attributes inherited from BaseQuery
#request
Instance Method Summary
collapse
Methods inherited from BaseQuery
#initialize
Instance Method Details
#command ⇒ Object
116
117
118
119
120
121
122
123
124
125
126
127
|
# File 'lib/test_launcher/queries.rb', line 116
def command
if test_cases.empty?
shell.warn("Could not identify file: #{request.search_string}")
elsif test_cases.size == 1
shell.notify("Found 1 example in 1 file.")
runner.single_example(test_cases.first)
else
shell.notify "Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}."
shell.notify "Running most recently edited. Run with '--all' to run all the tests."
runner.single_example(most_recently_edited_test_case)
end
end
|
#potential_files ⇒ Object
139
140
141
|
# File 'lib/test_launcher/queries.rb', line 139
def potential_files
@potential_files ||= searcher.test_files(request.search_string)
end
|
#test_cases ⇒ Object
129
130
131
132
133
134
135
136
137
|
# File 'lib/test_launcher/queries.rb', line 129
def test_cases
@test_cases ||= potential_files.map {|file|
request.test_case(
file: file,
example: request.example_name,
request: request,
)
}
end
|