Class: TurnipFormatter::StepTemplate::Exception

Inherits:
Base
  • Object
show all
Defined in:
lib/turnip_formatter/step_template/exception.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#formatted_backtrace, hooks, inherited, on_failed, on_passed, on_pending

Class Method Details

.cssObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/turnip_formatter/step_template/exception.rb', line 10

def self.css
  "section.scenario div.steps div.step_exception {\nmargin: 1em 0em;\npadding: 1em;\nborder: 1px solid #999999;\nbackground-color: #eee8d5;\ncolor: #586e75;\n}\n\nsection.scenario div.steps div.step_exception dd {\nmargin-top: 1em;\nmargin-left: 1em;\n}\n"
end

Instance Method Details

#build_failed(example) ⇒ Object

Parameters:

  • example (RSpec::Core::Example)


30
31
32
# File 'lib/turnip_formatter/step_template/exception.rb', line 30

def build_failed(example)
  build(example.exception.to_s, formatted_backtrace(example))
end

#build_pending(example) ⇒ Object

Parameters:

  • example (RSpec::Core::Example)


37
38
39
40
# File 'lib/turnip_formatter/step_template/exception.rb', line 37

def build_pending(example)
  result = TurnipFormatter::Helper.example_execution_result(example)
  build(result.pending_message, [example.location])
end