Class: Konacha::Example

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

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ Example

Returns a new instance of Example.



93
94
95
# File 'lib/konacha/runner.rb', line 93

def initialize(row)
  @row = row
end

Instance Method Details

#failure_messageObject



101
102
103
104
105
106
107
108
109
# File 'lib/konacha/runner.rb', line 101

def failure_message
  unless passed?
    msg = []
    msg << "  Failed: #{@row['name']}"
    msg << "    #{@row['message']}"
    msg << "    in #{@row['trace']['fileName']}:#{@row['trace']['lineNumber']}" if @row['trace']
    msg.join("\n")
  end
end

#passed?Boolean

Returns:

  • (Boolean)


97
98
99
# File 'lib/konacha/runner.rb', line 97

def passed?
  @row['passed']
end