Class: PrettyFace::Formatter::ReportStep
- Inherits:
-
Object
- Object
- PrettyFace::Formatter::ReportStep
- Defined in:
- lib/pretty_face/formatter/report.rb
Defined Under Namespace
Classes: SnippetExtractor
Instance Attribute Summary collapse
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#error ⇒ Object
Returns the value of attribute error.
-
#file_colon_line ⇒ Object
Returns the value of attribute file_colon_line.
-
#keyword ⇒ Object
Returns the value of attribute keyword.
-
#multiline_arg ⇒ Object
Returns the value of attribute multiline_arg.
-
#name ⇒ Object
Returns the value of attribute name.
-
#status ⇒ Object
Returns the value of attribute status.
-
#table ⇒ Object
Returns the value of attribute table.
Instance Method Summary collapse
-
#extra_failure_content(file_colon_line) ⇒ Object
from cucumber ===================.
- #failed_with_error? ⇒ Boolean
- #file_with_error(file_colon_line) ⇒ Object
- #has_multiline_arg? ⇒ Boolean
- #has_table? ⇒ Boolean
-
#initialize(step) ⇒ ReportStep
constructor
A new instance of ReportStep.
Constructor Details
#initialize(step) ⇒ ReportStep
Returns a new instance of ReportStep.
192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/pretty_face/formatter/report.rb', line 192 def initialize(step) @name = step.name @file_colon_line = step.file_colon_line unless step.instance_of? Cucumber::Ast::Background if step.respond_to? :actual_keyword @keyword = step.actual_keyword else @keyword = step.keyword end @status = step.status @multiline_arg = step.multiline_arg @error = step.exception end end |
Instance Attribute Details
#duration ⇒ Object
Returns the value of attribute duration.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def duration @duration end |
#error ⇒ Object
Returns the value of attribute error.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def error @error end |
#file_colon_line ⇒ Object
Returns the value of attribute file_colon_line.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def file_colon_line @file_colon_line end |
#keyword ⇒ Object
Returns the value of attribute keyword.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def keyword @keyword end |
#multiline_arg ⇒ Object
Returns the value of attribute multiline_arg.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def multiline_arg @multiline_arg end |
#name ⇒ Object
Returns the value of attribute name.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def name @name end |
#status ⇒ Object
Returns the value of attribute status.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def status @status end |
#table ⇒ Object
Returns the value of attribute table.
190 191 192 |
# File 'lib/pretty_face/formatter/report.rb', line 190 def table @table end |
Instance Method Details
#extra_failure_content(file_colon_line) ⇒ Object
from cucumber ===================
226 227 228 229 |
# File 'lib/pretty_face/formatter/report.rb', line 226 def extra_failure_content(file_colon_line) @snippet_extractor ||= SnippetExtractor.new @snippet_extractor.snippet(file_colon_line) end |
#failed_with_error? ⇒ Boolean
207 208 209 |
# File 'lib/pretty_face/formatter/report.rb', line 207 def failed_with_error? status == :failed && !error.nil? end |
#file_with_error(file_colon_line) ⇒ Object
219 220 221 222 223 |
# File 'lib/pretty_face/formatter/report.rb', line 219 def file_with_error(file_colon_line) @snippet_extractor ||= SnippetExtractor.new file, line = @snippet_extractor.file_name_and_line(file_colon_line) file end |
#has_multiline_arg? ⇒ Boolean
215 216 217 |
# File 'lib/pretty_face/formatter/report.rb', line 215 def has_multiline_arg? !multiline_arg.nil? && !has_table? end |
#has_table? ⇒ Boolean
211 212 213 |
# File 'lib/pretty_face/formatter/report.rb', line 211 def has_table? not table.nil? end |