test_bench-session 3.0.0.0.pre.6 → 3.0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14f5e3eddb8da4c798212f87882e14cd22d349bbd4b7fbd2fb293ea48c0e9822
|
4
|
+
data.tar.gz: ca42f8262fc6246339cd8b7be923dd3773749370c58288b41438e3311175d0f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 203acc24e3ba210f9664e08ab80b0c64829ed9823edc8473d8b72367f2140957d44213683471c539e87de065c015ce3c9527bbf966c853a8b87a1a20cd4c2733
|
7
|
+
data.tar.gz: 9e3e3e73efc83697cb654eff19ffb24754442860bd7f261c05ac981ae78c9fc68f806c6a9b3a00e81d62de0c52690742e248a89825892542a88d1554abd8ccc3
|
@@ -30,10 +30,12 @@ module TestBench
|
|
30
30
|
|
31
31
|
module Styling
|
32
32
|
def self.example
|
33
|
+
backtrace = AbsolutePaths::Local::Backtrace.example(styling: true)
|
34
|
+
|
33
35
|
[
|
34
|
-
|
36
|
+
backtrace.first,
|
35
37
|
"\e[2;3m*omitted*\e[23;22m",
|
36
|
-
|
38
|
+
backtrace.last
|
37
39
|
]
|
38
40
|
end
|
39
41
|
end
|
@@ -65,13 +67,37 @@ module TestBench
|
|
65
67
|
end
|
66
68
|
|
67
69
|
def self.backtrace
|
68
|
-
|
69
|
-
backtrace_location.to_s.delete_prefix(::File.join(apex_directory, ''))
|
70
|
-
end
|
70
|
+
Backtrace.example
|
71
71
|
end
|
72
72
|
|
73
73
|
def self.apex_directory
|
74
|
-
|
74
|
+
Backtrace.apex_directory
|
75
|
+
end
|
76
|
+
|
77
|
+
module Backtrace
|
78
|
+
def self.example(styling: nil)
|
79
|
+
styling ||= false
|
80
|
+
|
81
|
+
if styling
|
82
|
+
relative_path_prefix = "\e[2m./\e[22m"
|
83
|
+
else
|
84
|
+
relative_path_prefix = "./"
|
85
|
+
end
|
86
|
+
|
87
|
+
Exception::AbsolutePaths::Example.backtrace_locations.map do |backtrace_location|
|
88
|
+
backtrace_location_text = backtrace_location.to_s
|
89
|
+
|
90
|
+
backtrace_location_text.delete_prefix!(::File.join(apex_directory, ''))
|
91
|
+
|
92
|
+
backtrace_location_text.insert(0, relative_path_prefix)
|
93
|
+
|
94
|
+
backtrace_location_text
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.apex_directory
|
99
|
+
Path::ApexDirectory.tmpdir
|
100
|
+
end
|
75
101
|
end
|
76
102
|
end
|
77
103
|
end
|
@@ -38,7 +38,7 @@ module TestBench
|
|
38
38
|
if styling?
|
39
39
|
omitted_text = "\e[2;3m*omitted*\e[23;22m"
|
40
40
|
else
|
41
|
-
omitted_text =
|
41
|
+
omitted_text = '*omitted*'
|
42
42
|
end
|
43
43
|
|
44
44
|
backtrace = []
|
@@ -64,10 +64,8 @@ module TestBench
|
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
apex_directory_prefix = ::File.join(apex_directory, '')
|
68
|
-
|
69
67
|
backtrace.each do |backtrace_location_text|
|
70
|
-
backtrace_location_text
|
68
|
+
delete_apex_directory_prefix(backtrace_location_text)
|
71
69
|
end
|
72
70
|
|
73
71
|
exception.set_backtrace(backtrace)
|
@@ -83,7 +81,7 @@ module TestBench
|
|
83
81
|
location ||= exception.backtrace_locations.first
|
84
82
|
|
85
83
|
location = "#{location.path}:#{location.lineno}"
|
86
|
-
location
|
84
|
+
delete_apex_directory_prefix(location)
|
87
85
|
location
|
88
86
|
end
|
89
87
|
|
@@ -95,6 +93,20 @@ module TestBench
|
|
95
93
|
end
|
96
94
|
end
|
97
95
|
|
96
|
+
def delete_apex_directory_prefix(backtrace_location_text)
|
97
|
+
if styling?
|
98
|
+
relative_path_prefix = "\e[2m./\e[22m"
|
99
|
+
else
|
100
|
+
relative_path_prefix = './'
|
101
|
+
end
|
102
|
+
|
103
|
+
apex_directory_prefix = ::File.join(apex_directory, '')
|
104
|
+
|
105
|
+
if backtrace_location_text.delete_prefix!(apex_directory_prefix)
|
106
|
+
backtrace_location_text.insert(0, relative_path_prefix)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
98
110
|
module Defaults
|
99
111
|
def self.omit_patterns
|
100
112
|
env_omit_backtrace_pattern = ENV.fetch('TEST_BENCH_OMIT_BACKTRACE_PATTERN', '')
|