Module: Tryouts::EvalAnchor
- Included in:
- OrphanBlock, Setup, Teardown, TestCase
- Defined in:
- lib/tryouts/test_case.rb
Overview
A block is evaluated starting at its first executable line, not at its line_range.first: a block opens at its description or a leading comment, while the extracted code begins at the first statement. Getting this wrong misattributes every backtrace line in the block. Hand-built blocks (e.g. translator fixtures) may omit first_code_line and fall back to the start.
Instance Method Summary collapse
Instance Method Details
#eval_start_line ⇒ Object
13 14 15 |
# File 'lib/tryouts/test_case.rb', line 13 def eval_start_line (first_code_line || line_range.first) + 1 end |