Module: StackTrace::Rspec

Defined in:
lib/stack_trace/rspec.rb,
lib/stack_trace/rspec/version.rb

Constant Summary collapse

EXAMPLE_META_KEYS =
i[file_path line_number scoped_id description full_description].freeze
FINAL_MESSAGE =
"\\e[1m\nStackTrace:\n\nTrace information is saved into \\e[32m%<file_path>s\\e[0m\n\\e[22m\n"
VERSION =
"0.6.0"

Class Method Summary collapse

Class Method Details

.finish_tracing ⇒ Object



31
32
33
34
35
36
# File 'lib/stack_trace/rspec.rb', line 31

def finish_tracing
  ensure_path_is_created!

  html.save(file_path)
      .then { |path| print_message(path) }
end

.store_trace(trace, example) ⇒ Object



38
39
40
# File 'lib/stack_trace/rspec.rb', line 38

def store_trace(trace, example)
  html.add(trace, **example..slice(*EXAMPLE_META_KEYS))
end