Class: Oopsy

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_html_reporter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(example, file_path) ⇒ Oopsy

Returns a new instance of Oopsy.



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/rspec_html_reporter.rb', line 15

def initialize(example, file_path)
  @example = example
  @exception = @example.exception
  @file_path = file_path
  unless @exception.nil?
    @klass = @exception.class
    @message = @exception.message.encode('utf-8')
    @backtrace = @exception.backtrace
    @backtrace_message = formatted_backtrace(@example, @exception)
    @highlighted_source = process_source
    @explanation = process_message
  end
end

Instance Attribute Details

#backtraceObject (readonly)

Returns the value of attribute backtrace.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def backtrace
  @backtrace
end

#backtrace_messageObject (readonly)

Returns the value of attribute backtrace_message.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def backtrace_message
  @backtrace_message
end

#explanationObject (readonly)

Returns the value of attribute explanation.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def explanation
  @explanation
end

#highlighted_sourceObject (readonly)

Returns the value of attribute highlighted_source.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def highlighted_source
  @highlighted_source
end

#klassObject (readonly)

Returns the value of attribute klass.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def klass
  @klass
end

#messageObject (readonly)

Returns the value of attribute message.



13
14
15
# File 'lib/rspec_html_reporter.rb', line 13

def message
  @message
end