Module: Emendate::Examples::ResultTestable

Defined in:
lib/emendate/examples/result_testable.rb

Overview

Mixin module for Examples::Tester

Instance Method Summary collapse

Instance Method Details

#expected_resultObject



7
8
9
10
11
# File 'lib/emendate/examples/result_testable.rb', line 7

def expected_result
  return nil unless example.testable?

  example.rows.first.send(name.to_sym)
end

#tested_resultObject



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/emendate/examples/result_testable.rb', line 13

def tested_result
  return nil unless example.testable?

  result = example.processed
    .result
    .send(name.delete_prefix("result_").to_sym)

  if result.empty?
    "na"
  else
    result.join("|")
  end
end