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
30module EquivalenceCases
40 module InterpolatedAttributeQuotes
50 class InterpolatedAttributeQuotes < Phlex::HTML
60 def self.equivalence_scenarios
7 {
80 "quoted" => -> (klass) { klass.new(%(say "hi")).call },
90 "invalid UTF-8" => -> (klass) { klass.new((+"\"\xFF").force_encoding(Encoding::UTF_8)).call },
100 "UTF-16" => -> (klass) { klass.new(%("x").encode(Encoding::UTF_16LE)).call },
11 }
12 end
13
140 def initialize(value = "plain")
150 @value = value
16 end
17
180 def view_template
190 div(title: "#{@value}") { "y" } # rubocop:disable Style/RedundantInterpolation
200 div(title: "a #{@value}", id: "b-#{@value}") { "x" }
210 input(value: "#{@value}#{@value}")
220 plain($~.inspect)
23 rescue Encoding::CompatibilityError
240 plain "rescued"
25 end
26 end
27 end
28end