Class: Oopsy
- Inherits:
-
Object
- Object
- Oopsy
- Defined in:
- lib/rspec_html_formatter.rb
Instance Attribute Summary collapse
-
#backtrace ⇒ Object
readonly
Returns the value of attribute backtrace.
-
#backtrace_message ⇒ Object
readonly
Returns the value of attribute backtrace_message.
-
#explanation ⇒ Object
readonly
Returns the value of attribute explanation.
-
#highlighted_source ⇒ Object
readonly
Returns the value of attribute highlighted_source.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(exception, file_path) ⇒ Oopsy
constructor
A new instance of Oopsy.
Constructor Details
#initialize(exception, file_path) ⇒ Oopsy
Returns a new instance of Oopsy.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/rspec_html_formatter.rb', line 14 def initialize(exception, file_path) @exception = exception @file_path = file_path unless @exception.nil? @klass = @exception.class @message = @exception..encode('utf-8') @backtrace = @exception.backtrace @backtrace_message = @backtrace.select { |r| r.match(@file_path) }.join('').encode('utf-8') @highlighted_source = process_source @explanation = end end |
Instance Attribute Details
#backtrace ⇒ Object (readonly)
Returns the value of attribute backtrace.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def backtrace @backtrace end |
#backtrace_message ⇒ Object (readonly)
Returns the value of attribute backtrace_message.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def @backtrace_message end |
#explanation ⇒ Object (readonly)
Returns the value of attribute explanation.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def explanation @explanation end |
#highlighted_source ⇒ Object (readonly)
Returns the value of attribute highlighted_source.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def highlighted_source @highlighted_source end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def klass @klass end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
12 13 14 |
# File 'lib/rspec_html_formatter.rb', line 12 def @message end |