Class: Tryouts::TestCase
- Inherits:
-
Data
- Object
- Data
- Tryouts::TestCase
- Includes:
- EvalAnchor
- Defined in:
- lib/tryouts/test_case.rb
Overview
Core data structures
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#expectations ⇒ Object
readonly
Returns the value of attribute expectations.
-
#first_code_line ⇒ Object
readonly
Returns the value of attribute first_code_line.
-
#first_expectation_line ⇒ Object
readonly
Returns the value of attribute first_expectation_line.
-
#line_range ⇒ Object
readonly
Returns the value of attribute line_range.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#source_lines ⇒ Object
readonly
Returns the value of attribute source_lines.
Instance Method Summary collapse
- #empty? ⇒ Boolean
- #exception_expectations ⇒ Object
- #exception_expectations? ⇒ Boolean
- #expectations? ⇒ Boolean
-
#initialize(first_code_line: nil, **rest) ⇒ TestCase
constructor
A new instance of TestCase.
- #regular_expectations ⇒ Object
Methods included from EvalAnchor
Constructor Details
#initialize(first_code_line: nil, **rest) ⇒ TestCase
Returns a new instance of TestCase.
22 23 24 |
# File 'lib/tryouts/test_case.rb', line 22 def initialize(first_code_line: nil, **rest) super end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def description @description end |
#expectations ⇒ Object (readonly)
Returns the value of attribute expectations
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def expectations @expectations end |
#first_code_line ⇒ Object (readonly)
Returns the value of attribute first_code_line
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def first_code_line @first_code_line end |
#first_expectation_line ⇒ Object (readonly)
Returns the value of attribute first_expectation_line
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def first_expectation_line @first_expectation_line end |
#line_range ⇒ Object (readonly)
Returns the value of attribute line_range
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def line_range @line_range end |
#path ⇒ Object (readonly)
Returns the value of attribute path
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def path @path end |
#source_lines ⇒ Object (readonly)
Returns the value of attribute source_lines
19 20 21 |
# File 'lib/tryouts/test_case.rb', line 19 def source_lines @source_lines end |
Instance Method Details
#empty? ⇒ Boolean
26 27 28 |
# File 'lib/tryouts/test_case.rb', line 26 def empty? code.empty? end |
#exception_expectations ⇒ Object
42 43 44 |
# File 'lib/tryouts/test_case.rb', line 42 def exception_expectations expectations.filter(&:exception?) end |
#exception_expectations? ⇒ Boolean
34 35 36 |
# File 'lib/tryouts/test_case.rb', line 34 def exception_expectations? expectations.any?(&:exception?) end |
#expectations? ⇒ Boolean
30 31 32 |
# File 'lib/tryouts/test_case.rb', line 30 def expectations? !expectations.empty? end |
#regular_expectations ⇒ Object
38 39 40 |
# File 'lib/tryouts/test_case.rb', line 38 def regular_expectations expectations.filter(&:regular?) end |