9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/runner.rb', line 9
def run!(test_definition)
subject = Subject.from(test_definition[:subject])
source = test_definition[:source]
check_head_position = test_definition[:check_head_position]
show_initial_board = test_definition.fetch(:show_initial_board, true)
begin
[test_definition[:examples].map do |example_definition|
run_example!(example_definition, check_head_position, show_initial_board, source, subject)
end]
rescue Gobstones::AbortedError => e
test_definition[:expect_endless_while] ? [e.message, :passed] : [e.message, e.status]
rescue Gobstones::Error => e
[e.message, e.status]
end
end
|