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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/stack_trace/rspec/version.rb +1 -1
- data/lib/stack_trace/rspec.rb +11 -1
- 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: 8c919857275574dcd0d3892bb2fae3b137e742de6fb542a0bdee4424aa0e5513
|
4
|
+
data.tar.gz: 43e7a4987ddc23299d00d1ee19405705d68f78875784a6e97b603cc3419e6c52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66fada6f46c3967efb4d99f6daad8a2bf6fe3419c079bb3f61ad4b41c89b92b67ddaf4e36fd635b304c423038ba7e4c64b8c9f15651dd26d9b13e74d5b7fd956
|
7
|
+
data.tar.gz: daa880aba8892dcedd3a3c00b559b50ef3aafe6a0b7018fe1e6847f5ef2ef2b459f42981c04f767537a1ada6afb1db48cb206c38d001cb52eac71922764b0452
|
data/Gemfile.lock
CHANGED
data/lib/stack_trace/rspec.rb
CHANGED
@@ -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
|