Class: Ask::Eval::TestCase
- Inherits:
-
Data
- Object
- Data
- Ask::Eval::TestCase
- Defined in:
- lib/ask/eval/test_case.rb
Instance Attribute Summary collapse
-
#actual_output ⇒ Object
readonly
Returns the value of attribute actual_output.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#expected_output ⇒ Object
readonly
Returns the value of attribute expected_output.
-
#input ⇒ Object
readonly
Returns the value of attribute input.
Instance Method Summary collapse
-
#initialize(input: nil, actual_output:, expected_output: nil, context: nil) ⇒ TestCase
constructor
A new instance of TestCase.
-
#inspect ⇒ String
A concise description for logging.
Constructor Details
#initialize(input: nil, actual_output:, expected_output: nil, context: nil) ⇒ TestCase
Returns a new instance of TestCase.
10 11 12 13 |
# File 'lib/ask/eval/test_case.rb', line 10 def initialize(input: nil, actual_output:, expected_output: nil, context: nil) super(input: input, actual_output: actual_output, expected_output: expected_output, context: context) end |
Instance Attribute Details
#actual_output ⇒ Object (readonly)
Returns the value of attribute actual_output
5 6 7 |
# File 'lib/ask/eval/test_case.rb', line 5 def actual_output @actual_output end |
#context ⇒ Object (readonly)
Returns the value of attribute context
5 6 7 |
# File 'lib/ask/eval/test_case.rb', line 5 def context @context end |
#expected_output ⇒ Object (readonly)
Returns the value of attribute expected_output
5 6 7 |
# File 'lib/ask/eval/test_case.rb', line 5 def expected_output @expected_output end |
#input ⇒ Object (readonly)
Returns the value of attribute input
5 6 7 |
# File 'lib/ask/eval/test_case.rb', line 5 def input @input end |
Instance Method Details
#inspect ⇒ String
Returns a concise description for logging.
16 17 18 19 20 |
# File 'lib/ask/eval/test_case.rb', line 16 def inspect input_preview = input ? " input=#{input.to_s[0..50].inspect}" : "" output_preview = " output=#{actual_output.to_s[0..50].inspect}" "#<Ask::Eval::TestCase#{input_preview}#{output_preview}>" end |