6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/uspec/dsl.rb', line 6
def spec description
terminal = Uspec::Terminal
print ' -- ', description
return print(': ' + terminal.yellow('pending') + terminal.newline) unless block_given?
begin
raw_result = yield
rescue => raw_result
end
result = Result.new description, raw_result, caller
Uspec::Stats.results << result
print ': ', result.pretty, "\n"
rescue => error
message = " \#{error.class} : \#{error.message}\n\n Uspec encountered an internal error, please report this bug: https://github.com/acook/uspec/issues/new\n\n\\t\#{error.backtrace.join \"\\n\\t\"}\n MSG\n puts\n warn message\n Uspec::Stats.results << Uspec::Result.new(message, error, caller)\nend\n"
|