quickdraw/compilation_equivalence_cases/reopened_set_constant.rb
Lines
100%14 of 14 covered
Branches
—0 of 0 covered
Methods
100%4 of 4 covered
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 1 | module EquivalenceCases |
| 4 | 1 | module ReopenedSetConstant |
| 5 | 1 | class ReopenedSetConstant < Phlex::HTML |
| 6 | 1 | def view_template |
| 7 | 6 | with_standard_set |
| 8 | 6 | with_custom_set |
| 9 | end | |
| 10 | ||
| 11 | 1 | def with_standard_set |
| 12 | 6 | div(class: Set["a", "b"]) { "standard" } |
| 13 | end | |
| 14 | end | |
| 15 | ||
| 16 | 1 | module CustomSetScope |
| 17 | 1 | module Set |
| 18 | 1 | def self.[](*) = ["custom"] |
| 19 | end | |
| 20 | ||
| 21 | # Reopened inside a scope with its own Set, which the class's name | |
| 22 | # doesn't reveal. | |
| 23 | 1 | class ::EquivalenceCases::ReopenedSetConstant::ReopenedSetConstant |
| 24 | 1 | def with_custom_set |
| 25 | 6 | div(class: Set["a", "b"]) { "custom" } |
| 26 | end | |
| 27 | end | |
| 28 | end | |
| 29 | end | |
| 30 | end |