enhanced_errors 2.0.0 → 2.0.1
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 +4 -4
- data/enhanced_errors.gemspec +1 -1
- data/lib/enhanced_errors.rb +13 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a4579802affa3f4ee55675cadce0a0782e239e95cacdeb3eac12c6a716c913e
|
4
|
+
data.tar.gz: 81e803f5ae6f247f6f38b116e92d3d07befed02028927cdb07dad3b7f0b87d28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a110f026595e2dc79a65a311844860311f6454d593d5231604c368658526d2830d231c25417338e4b43f18febfc06158c3fa57c607ec47e1cf8dc4d4929077ab
|
7
|
+
data.tar.gz: ea199eaedd965fdcae33b99c3709e0ba1b0b492505506a2f9b0cb00daf1773225526670fb0537ade59bf300343e5d8cc32fd76c5906037d5e0522c2b88315e4c
|
data/enhanced_errors.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = "enhanced_errors"
|
3
|
-
spec.version = "2.0.
|
3
|
+
spec.version = "2.0.1"
|
4
4
|
spec.authors = ["Eric Beland"]
|
5
5
|
|
6
6
|
spec.summary = "Automatically enhance your errors with messages containing variable values from the moment they were raised."
|
data/lib/enhanced_errors.rb
CHANGED
@@ -30,15 +30,18 @@ class EnhancedErrors
|
|
30
30
|
|
31
31
|
# Add @__memoized and @__inspect_output to the skip list so they don't appear in output
|
32
32
|
RSPEC_SKIP_LIST = Set.new([
|
33
|
+
:@example,
|
33
34
|
:@fixture_cache,
|
34
35
|
:@fixture_cache_key,
|
36
|
+
:@fixture_connections,
|
35
37
|
:@fixture_connection_pools,
|
38
|
+
:@loaded_fixtures,
|
36
39
|
:@connection_subscriber,
|
37
40
|
:@saved_pool_configs,
|
38
|
-
:@
|
41
|
+
:@legacy_saved_pool_configs,
|
39
42
|
:@matcher_definitions,
|
40
|
-
:@__memoized,
|
41
|
-
:@__inspect_output
|
43
|
+
:@__memoized,
|
44
|
+
:@__inspect_output
|
42
45
|
])
|
43
46
|
|
44
47
|
RAILS_SKIP_LIST = Set.new([
|
@@ -188,7 +191,11 @@ class EnhancedErrors
|
|
188
191
|
@rspec_tracepoint = nil
|
189
192
|
|
190
193
|
@rspec_tracepoint = TracePoint.new(:b_return) do |tp|
|
191
|
-
|
194
|
+
# This is super-kluge-y and should be replaced with... something TBD
|
195
|
+
if tp.self.class.name =~ /RSpec::ExampleGroups::[A-Z0-9]+.*/ &&
|
196
|
+
tp.method_id.nil? &&
|
197
|
+
!(tp.path =~ /rspec/) &&
|
198
|
+
tp.path =~ /_spec\.rb$/
|
192
199
|
@rspec_example_binding = tp.binding
|
193
200
|
end
|
194
201
|
end
|
@@ -196,7 +203,8 @@ class EnhancedErrors
|
|
196
203
|
end
|
197
204
|
|
198
205
|
def stop_rspec_binding_capture
|
199
|
-
@rspec_tracepoint
|
206
|
+
@rspec_tracepoint&.disable
|
207
|
+
@rspec_tracepoint = nil
|
200
208
|
binding_info = convert_binding_to_binding_info(@rspec_example_binding) if @rspec_example_binding
|
201
209
|
@rspec_example_binding = nil
|
202
210
|
binding_info
|