Class: Konacha::Example
- Inherits:
-
Object
- Object
- Konacha::Example
- Defined in:
- lib/konacha/runner.rb
Instance Method Summary collapse
- #failed? ⇒ Boolean
- #failure_message ⇒ Object
-
#initialize(row) ⇒ Example
constructor
A new instance of Example.
- #passed? ⇒ Boolean
- #pending? ⇒ Boolean
Constructor Details
#initialize(row) ⇒ Example
Returns a new instance of Example.
110 111 112 |
# File 'lib/konacha/runner.rb', line 110 def initialize(row) @row = row end |
Instance Method Details
#failed? ⇒ Boolean
122 123 124 |
# File 'lib/konacha/runner.rb', line 122 def failed? !(@row['passed'] || @row['pending']) end |
#failure_message ⇒ Object
126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/konacha/runner.rb', line 126 def if failed? msg = [] msg << " Failed: #{@row['name']}" msg << " #{@row['message']}" msg << " in #{@row['trace']['fileName']}:#{@row['trace']['lineNumber']}" if @row['trace'] msg.join("\n").red elsif pending? " Pending: #{@row['name']}".yellow end end |
#passed? ⇒ Boolean
114 115 116 |
# File 'lib/konacha/runner.rb', line 114 def passed? @row['passed'] end |
#pending? ⇒ Boolean
118 119 120 |
# File 'lib/konacha/runner.rb', line 118 def pending? @row['pending'] end |