quickdraw/compilation_equivalence_cases/interpolated_attribute_quotes.rb
Lines
0%0 of 15 covered
Branches
—0 of 0 covered
Methods
0%0 of 2 covered
- Not run
- 3-68-1014-1518-2224
- Never called
| 1 | # frozen_string_literal: true | |
| 2 | ||
| 3 | 0 | module EquivalenceCases |
| 4 | 0 | module InterpolatedAttributeQuotes |
| 5 | 0 | class InterpolatedAttributeQuotes < Phlex::HTML |
| 6 | 0 | def self.equivalence_scenarios |
| 7 | { | |
| 8 | 0 | "quoted" => -> (klass) { klass.new(%(say "hi")).call }, |
| 9 | 0 | "invalid UTF-8" => -> (klass) { klass.new((+"\"\xFF").force_encoding(Encoding::UTF_8)).call }, |
| 10 | 0 | "UTF-16" => -> (klass) { klass.new(%("x").encode(Encoding::UTF_16LE)).call }, |
| 11 | } | |
| 12 | end | |
| 13 | ||
| 14 | 0 | def initialize(value = "plain") |
| 15 | 0 | @value = value |
| 16 | end | |
| 17 | ||
| 18 | 0 | def view_template |
| 19 | 0 | div(title: "#{@value}") { "y" } # rubocop:disable Style/RedundantInterpolation |
| 20 | 0 | div(title: "a #{@value}", id: "b-#{@value}") { "x" } |
| 21 | 0 | input(value: "#{@value}#{@value}") |
| 22 | 0 | plain($~.inspect) |
| 23 | rescue Encoding::CompatibilityError | |
| 24 | 0 | plain "rescued" |
| 25 | end | |
| 26 | end | |
| 27 | end | |
| 28 | end |