Class: Spec::Runner::Reporter::Failure

Inherits:
Object
  • Object
show all
Defined in:
lib/spec/runner/reporter.rb

Instance Method Summary collapse

Constructor Details

#initialize(context_name, spec_name, exception) ⇒ Failure

Returns a new instance of Failure.



75
76
77
78
79
# File 'lib/spec/runner/reporter.rb', line 75

def initialize(context_name, spec_name, exception)
  @context_name = context_name
  @spec_name = spec_name
  @exception = exception
end

Instance Method Details

#backtraceObject



89
90
91
# File 'lib/spec/runner/reporter.rb', line 89

def backtrace
  @exception.backtrace.nil? ? "" : @exception.backtrace.join("\n")
end

#headerObject



81
82
83
# File 'lib/spec/runner/reporter.rb', line 81

def header
  "#{class_name} in '#{@context_name} #{@spec_name}'"
end

#messageObject



85
86
87
# File 'lib/spec/runner/reporter.rb', line 85

def message
  @exception.message
end