13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/m/executor.rb', line 13
def execute
tests_to_run = tests.within(testable.lines)
if tests_to_run.size > 0
test_names = tests_to_run.map { |test| Regexp.escape(test.name) }.join('|')
test_arguments = ["-n", "/^(#{test_names})$/"]
runner.run(test_arguments)
elsif tests.size > 0
message = "No tests found on line #{testable.lines.join(', ')}. Valid tests to run:\n\n"
tests.by_line_number do |test|
message << "#{sprintf("%0#{tests.column_size}s", test.name)}: m #{testable.file}:#{test.start_line}\n"
end
STDERR.puts message
false
else
message = "There were no tests found.\n\n"
STDERR.puts message
false
end
end
|