rspec-debug 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d1438cb27952d2d8afda27e88b854e58d9ea63a09be2d66a65b05df7992f61
4
- data.tar.gz: 73de8f6f284e8118c9fc1ec7e8673cb179789e031291d5e531b804f612f851b4
3
+ metadata.gz: 7cbd773e36f58624d41ea037678f19d0017766e07c12edf717e591ed9e1744a0
4
+ data.tar.gz: 39e26f4334c9c4d35ede590d252ae6282d3b3ab652853e63a3dac1c39b6a2a61
5
5
  SHA512:
6
- metadata.gz: 826b4d04dca70fb52a8d355e3257fc93282c4307e9a75c12660e338658de45e85353cf13c1bd7db2af0bd925af808078f4d96b0f2a371374b2eaddb4841a8e3a
7
- data.tar.gz: a9ed097ae5245f2d11b351353aa521bae61d88975154ac57e5796a48d9433c82af4c5d08a3874a1d2fb54e5ed0707b06403fca2a12abc512f573d11469b2cf9a
6
+ metadata.gz: 62d10caa883bff3aa1bac384c4074500fb8ad7cbd267c349744088e000f1ebac78cd41f3e3708a86644ccb07eb99eb3005e5c7f3b5ab9749f6d1544c9727e84e
7
+ data.tar.gz: 55fa5fe0c8bab7a26c98c0aec8b7be06402ee74a35cacb53474ed6b82d48eb3fe1e36008d9e68f8df2e2236398d8481c983a8b355f09e9120834887cffcd8d52
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Debug
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
data/lib/rspec/debug.rb CHANGED
@@ -15,26 +15,17 @@ module RSpec
15
15
 
16
16
  if example_block
17
17
  example_block = Proc.new do
18
- begin
19
- postmortem_hook = TracePoint.new(:raise){|tp|
20
- exc = tp.raised_exception
21
- frames = DEBUGGER__.capture_frames(nil)
22
- frames.delete_if{|e| /(exe|bin|lib)\/rspec/ =~ e.path}
23
- exc.instance_variable_set(:@__debugger_postmortem_frames, frames)
24
- }
25
-
26
- postmortem_hook.enable
27
- begin
28
- self.instance_eval(&orig_example_block)
29
- ensure
30
- postmortem_hook.disable
31
- end
18
+ e = DEBUGGER__::SESSION.capture_exception_frames /(exe|bin|lib)\/rspec/ do
19
+ self.instance_exec(&orig_example_block)
20
+ end
32
21
 
33
- rescue Exception => e
34
- STDERR.puts "Failure:"
35
- STDERR.puts e.message
22
+ if e
23
+ STDERR.puts <<~MSG
24
+ Failure:
25
+ #{e.message}
26
+ MSG
36
27
  DEBUGGER__::SESSION.enter_postmortem_session e
37
- raise
28
+ raise e
38
29
  end
39
30
  end # Proc.new
40
31
  end
@@ -42,8 +33,8 @@ module RSpec
42
33
  super
43
34
  end
44
35
  end
36
+
45
37
  prepend DebugAtStop
46
38
  end
47
39
  end
48
40
  end
49
-
data/rspec-debug.gemspec CHANGED
@@ -22,5 +22,5 @@ Gem::Specification.new do |spec|
22
22
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
23
  end
24
24
  spec.require_paths = ["lib"]
25
- spec.add_runtime_dependency 'debug', '>= 1.3.2'
25
+ spec.add_runtime_dependency 'debug', '>= 1.3.3'
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-debug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi Sasada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-28 00:00:00.000000000 Z
11
+ date: 2021-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.3.2
19
+ version: 1.3.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.3.2
26
+ version: 1.3.3
27
27
  description: invoke debugger if spec fails
28
28
  email:
29
29
  - ko1@atdot.net