3
4
5
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'lib/rspec/core/example.rb', line 3
def run(example_group_instance, reporter)
@example_group_instance = example_group_instance
@reporter = reporter
RSpec.configuration.configure_example(self, hooks)
RSpec.current_example = self
start(reporter)
Pending.mark_pending!(self, pending) if pending?
begin
if skipped?
Pending.mark_pending! self, skip
elsif !RSpec.configuration.dry_run?
with_around_and_singleton_context_hooks do
begin
if self.metadata[:services] != nil && self.metadata[:services].is_a?(Array) && ENV["LUCIAN_DOCKER"] == nil
result = run_lucian_test
if result[2].to_i != 0
pending_cut = result[0].join("\n").gsub("\n", "--_n").match(/(PENDING.*)FAILING/)[0] rescue nil
failing_cut = result[0].join("\n").gsub("\n", "--_n").match(/(FAILING.*)Finished/)[0] rescue nil
unless pending_cut.nil?
end
unless failing_cut.nil?
failing_cases = failing_cut.scan(/\|=:.*:=\|/)
failing_cases.each do |_case|
data_cases = _case.split(":=|").collect{|message|
message.gsub("|=:","").split(":|-|:").collect{|_em|
_em.gsub("--_n", "\n")
}
}
data_cases.each do |to_report|
lines = to_report[1]
traces = to_report[2]
error = StandardError.new(traces)
error.set_backtrace([lines])
raise error
end
end
end
end
else
run_before_example
@example_group_instance.instance_exec(self, &@example_block)
if pending?
Pending.mark_fixed! self
raise Pending::PendingExampleFixedError,
'Expected example to fail since it is pending, but it passed.',
[location]
end
end
rescue Pending::SkipDeclaredInExample
rescue AllExceptionsExcludingDangerousOnesOnRubiesThatAllowIt => e
set_exception(e)
ensure
run_after_example
end
end
end
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => e
set_exception(e)
ensure
@example_group_instance = nil
end
finish(reporter)
ensure
execution_result.ensure_timing_set(clock)
RSpec.current_example = nil
end
|