stack_trace-rspec 0.1.2 → 0.1.4

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: fe1405c511b23bdda3ffeaca356cd346180cb98dd963d913e65b024bcf7a5e73
4
- data.tar.gz: 81c7f9bccb0431b430d90f86a0738ff426091d8f57fd102ff3cc937ed0a9fd0b
3
+ metadata.gz: 8c919857275574dcd0d3892bb2fae3b137e742de6fb542a0bdee4424aa0e5513
4
+ data.tar.gz: 43e7a4987ddc23299d00d1ee19405705d68f78875784a6e97b603cc3419e6c52
5
5
  SHA512:
6
- metadata.gz: 1a3e5134f14afc8e9d820fe23a1df3776a7defc214793cb6deb07ebc3c5477577db0c29a2543862e67de7aa4088c49007d007d8385f88917a41ef3da5f44f040
7
- data.tar.gz: 12857df895f592ba270aa1f214669617ccb0e4c52d2d638ff528489a035e9bbfcfee31d2658af697a8c8f75e29c565d96ef8d02f67370a2317bf4062aa2f2f35
6
+ metadata.gz: 66fada6f46c3967efb4d99f6daad8a2bf6fe3419c079bb3f61ad4b41c89b92b67ddaf4e36fd635b304c423038ba7e4c64b8c9f15651dd26d9b13e74d5b7fd956
7
+ data.tar.gz: daa880aba8892dcedd3a3c00b559b50ef3aafe6a0b7018fe1e6847f5ef2ef2b459f42981c04f767537a1ada6afb1db48cb206c38d001cb52eac71922764b0452
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stack_trace-rspec (0.1.2)
4
+ stack_trace-rspec (0.1.4)
5
5
  stack_trace-viz (~> 0.2)
6
6
 
7
7
  GEM
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StackTrace
4
4
  module Rspec
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
@@ -4,6 +4,7 @@ require_relative "rspec/version"
4
4
 
5
5
  require "stack_trace/viz"
6
6
  require "pathname"
7
+ require "securerandom"
7
8
 
8
9
  RSpec.configuration.after(:suite) do
9
10
  StackTrace::Rspec.finish_tracing
@@ -28,6 +29,8 @@ module StackTrace
28
29
 
29
30
  class << self
30
31
  def finish_tracing
32
+ ensure_path_is_created!
33
+
31
34
  html.save(file_path)
32
35
  .then { |path| print_message(path) }
33
36
  end
@@ -38,6 +41,10 @@ module StackTrace
38
41
 
39
42
  private
40
43
 
44
+ def ensure_path_is_created!
45
+ Dir.mkdir(file_dir) unless File.directory?(file_dir)
46
+ end
47
+
41
48
  def html
42
49
  @html ||= StackTrace::Viz::HTML.new
43
50
  end
@@ -47,9 +54,12 @@ module StackTrace
47
54
  end
48
55
 
49
56
  def file_path
57
+ file_dir.join("#{SecureRandom.uuid}.html")
58
+ end
59
+
60
+ def file_dir
50
61
  Pathname.new(RSpec.configuration.default_path)
51
62
  .join("stack_trace")
52
- .join("#{Securerandom.uuid}.html")
53
63
  end
54
64
  end
55
65
  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.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Emin INAC