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
128
129
130
131
132
133
|
# 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
{
notifies: ["Found 1 example in 1 file."],
command: runner.single_example(test_cases.first)
}
else
{
notifies: [
"Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}.",
"Running most recently edited. Run with '--all' to run all the tests."
],
command: runner.single_example(most_recently_edited_test_case)
}
end
end
|
#potential_files ⇒ Object
145
146
147
|
# File 'lib/test_launcher/queries.rb', line 145
def potential_files
@potential_files ||= searcher.test_files(request.search_string)
end
|
#test_cases ⇒ Object
135
136
137
138
139
140
141
142
143
|
# File 'lib/test_launcher/queries.rb', line 135
def test_cases
@test_cases ||= potential_files.map {|file|
request.test_case(
file: file,
example: request.example_name,
request: request,
)
}
end
|