quickdraw/compilation_equivalence_cases/ruby2_keywords_alias.rb
Lines
50%5 of 10 covered
Branches
—0 of 0 covered
Methods
0%0 of 3 covered
- Not run
- 8-912-1319
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 1 | module EquivalenceCases |
| 4 | 1 | module Ruby2KeywordsAlias |
| 5 | # Marking the alias marks the body it shares with `delegate`, which | |
| 6 | # compiling `delegate` would lose. | |
| 7 | 1 | class Ruby2KeywordsAlias < Phlex::HTML |
| 8 | 0 | def view_template |
| 9 | 0 | delegate(name: "kwargs") |
| 10 | end | |
| 11 | ||
| 12 | 0 | def delegate(*args) |
| 13 | 0 | div { target(*args) } |
| 14 | end | |
| 15 | ||
| 16 | 1 | alias_method :forward, :delegate |
| 17 | 1 | ruby2_keywords :forward |
| 18 | ||
| 19 | 0 | def target(*, name: "positional") = name |
| 20 | end | |
| 21 | end | |
| 22 | end |