stack_trace-rspec 0.1.3 → 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: e87256ab41b5337395f25ec03dd050f8943f336a087f53e2645ddad48e045976
4
- data.tar.gz: 2ff5f9c437d80e5750d41a7d8f47f8c91bc2e51c703d2feb334986ade2cc460a
3
+ metadata.gz: ae136803ae7655dd7375a12f65dd27de42599718aab47fa4fe906ef80477f767
4
+ data.tar.gz: 6ca34c5da6cd81270f24cbb5f9075e2ce5013dde349c6f263a0d619e3fec589b
5
5
  SHA512:
6
- metadata.gz: 451a1965d98455b1895d5ed5bd86100f5ef5105270c2739e080321f274ed967ab3bd3a5e268ff59058364983deb1bad4e1b938df9d539bd9aeeaa5918039f3ed
7
- data.tar.gz: f0ffcfd14540dacd37142dab92d9bc12ccb34308e404e47f3aa1137fd2d48e6e87cf456472cad72309cedd6894ebbe402e861d1ac2fb319b4e7682fbed3fcb1d
6
+ metadata.gz: 21143b8c8f1bed3a37030badf5881c3c806e0cc9d78efbb0a5fa09df5b96a150f86cacd461132f335ea91984958f181118585eea61feb9b2147f11b4422593a3
7
+ data.tar.gz: 96688781f3d84d4bebc6b163e8a610ad596d95b38df24acf179cc118504aad22a5737f8a41f1c2d58563c65d0a0dac0f5613c3117fafc6e7438c7684fc0075d9
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stack_trace-rspec (0.1.3)
5
- stack_trace-viz (~> 0.2)
4
+ stack_trace-rspec (0.2.0)
5
+ stack_trace-viz (~> 0.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -22,9 +22,9 @@ GEM
22
22
  diff-lcs (>= 1.2.0, < 2.0)
23
23
  rspec-support (~> 3.12.0)
24
24
  rspec-support (3.12.0)
25
- stack_trace (0.3.0)
26
- stack_trace-viz (0.2.0)
27
- stack_trace (~> 0.3)
25
+ stack_trace (0.4.0)
26
+ stack_trace-viz (0.3.0)
27
+ stack_trace (~> 0.4)
28
28
 
29
29
  PLATFORMS
30
30
  arm64-darwin-21
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StackTrace
4
4
  module Rspec
5
- VERSION = "0.1.3"
5
+ VERSION = "0.2.0"
6
6
  end
7
7
  end
@@ -29,6 +29,8 @@ module StackTrace
29
29
 
30
30
  class << self
31
31
  def finish_tracing
32
+ ensure_path_is_created!
33
+
32
34
  html.save(file_path)
33
35
  .then { |path| print_message(path) }
34
36
  end
@@ -39,6 +41,10 @@ module StackTrace
39
41
 
40
42
  private
41
43
 
44
+ def ensure_path_is_created!
45
+ Dir.mkdir(file_dir) unless File.directory?(file_dir)
46
+ end
47
+
42
48
  def html
43
49
  @html ||= StackTrace::Viz::HTML.new
44
50
  end
@@ -48,9 +54,12 @@ module StackTrace
48
54
  end
49
55
 
50
56
  def file_path
57
+ file_dir.join("#{SecureRandom.uuid}.html")
58
+ end
59
+
60
+ def file_dir
51
61
  Pathname.new(RSpec.configuration.default_path)
52
62
  .join("stack_trace")
53
- .join("#{Securerandom.uuid}.html")
54
63
  end
55
64
  end
56
65
  end
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "stack_trace-viz", "~> 0.2"
30
+ spec.add_dependency "stack_trace-viz", "~> 0.3"
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack_trace-rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.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: '0.2'
26
+ version: '0.3'
27
27
  description: Automatically generates traces for test cases
28
28
  email:
29
29
  - mehmetemininac@gmail.com