quickdraw/compilation_equivalence_cases/pure_hash_keys.rb
Lines
0%0 of 17 covered
Branches
—0 of 0 covered
Methods
0%0 of 5 covered
- Not run
- 3-69-1114-1619-202225-2729
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module PureHashKeys |
| 5 | 0 | class RaisingKey |
| 6 | 0 | def hash = raise("hash") |
| 7 | end | |
| 8 | ||
| 9 | 0 | class PureHashKeys < Phlex::HTML |
| 10 | 0 | def self.equivalence_scenarios |
| 11 | 0 | { "fragment" => -> (klass) { klass.new.call(fragments: [:missing]) } } |
| 12 | end | |
| 13 | ||
| 14 | 0 | def view_template |
| 15 | 0 | literal_key |
| 16 | 0 | variable_key |
| 17 | end | |
| 18 | ||
| 19 | 0 | private def literal_key |
| 20 | 0 | div(RaisingKey.new => nil) |
| 21 | rescue RuntimeError | |
| 22 | 0 | plain "rescued literal" |
| 23 | end | |
| 24 | ||
| 25 | 0 | private def variable_key |
| 26 | 0 | key = RaisingKey.new |
| 27 | 0 | div(key => nil) |
| 28 | rescue RuntimeError | |
| 29 | 0 | plain "rescued variable" |
| 30 | end | |
| 31 | end | |
| 32 | end | |
| 33 | end |