Class: XhtmlTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
lib/feed_tools/vendor/html5/tests/test_lxp.rb

Instance Method Summary collapse

Instance Method Details

#test_brObject



193
194
195
196
197
198
199
200
201
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 193

def test_br
  assert_xhtml_equal <<EOX1
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>BR</title></head>
<body>
<br/>
</body></html>
EOX1
end

#test_mathmlObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 97

def test_mathml
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>MathML</title></head>
<body>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
  <mi>x</mi>
  <mo>=</mo>

  <mfrac>
  <mrow>
    <mrow>
    <mo>-</mo>
    <mi>b</mi>
    </mrow>
    <mo>&#177;</mo>
    <msqrt>

    <mrow>
      <msup>
      <mi>b</mi>
      <mn>2</mn>
      </msup>
      <mo>-</mo>
      <mrow>

      <mn>4</mn>
      <mo>&#8290;</mo>
      <mi>a</mi>
      <mo>&#8290;</mo>
      <mi>c</mi>
      </mrow>
    </mrow>

    </msqrt>
  </mrow>
  <mrow>
    <mn>2</mn>
    <mo>&#8290;</mo>
    <mi>a</mi>
  </mrow>
  </mfrac>

</mrow>
</math>
</body></html>
EOX
end

#test_prologObject



248
249
250
251
252
253
254
255
256
257
258
259
260
261
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 248

def test_prolog
  assert_xhtml_equal <<EOX1, <<EOX2.strip
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>PROLOG</title></head>
<body>
</body></html>
EOX2
end

#test_scriptObject



213
214
215
216
217
218
219
220
221
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 213

def test_script
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>SCRIPT</title></head>
<body>
<script>1 &lt; 2 &amp; 3</script>
</body></html>
EOX
end

#test_script_srcObject



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 223

def test_script_src
  assert_xhtml_equal <<EOX1, <<EOX2.strip
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>SCRIPT</title><script src="http://example.com"></script></head>
<body>
<script>1 &lt; 2 &amp; 3</script>
</body></html>
EOX2
end

#test_strongObject



203
204
205
206
207
208
209
210
211
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 203

def test_strong
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>STRONG</title></head>
<body>
<strong></strong>
</body></html>
EOX
end

#test_svgObject



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 147

def test_svg
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>SVG</title></head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<path d="M38,38c0-12,24-15,23-2c0,9-16,13-16,23v7h11v-4c0-9,17-12,17-27
     c-2-22-45-22-45,3zM45,70h11v11h-11z" fill="#371">
</path>
<circle cx="50" cy="50" r="45" fill="none" stroke="#371" stroke-width="10">
</circle>

</svg>
</body></html>
EOX
end

#test_tagsoupObject



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 263

def test_tagsoup
  assert_xhtml_equal <<EOX1, <<EOX2.strip
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>TAGSOUP</title></head>
<body>
<u/><blockquote><u/><p><u/>
</p></blockquote></body></html>
EOX2
end

#test_titleObject



239
240
241
242
243
244
245
246
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 239

def test_title
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>1 &lt; 2 &amp; 3</title></head>
<body>
</body></html>
EOX
end


164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/feed_tools/vendor/html5/tests/test_lxp.rb', line 164

def test_xlink
  assert_xhtml_equal <<EOX
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>XLINK</title></head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<defs xmlns:l="http://www.w3.org/1999/xlink">
  <radialGradient id="s1" fx=".4" fy=".2" r=".7">
  <stop stop-color="#FE8"/>
  <stop stop-color="#D70" offset="1"/>
  </radialGradient>
  <radialGradient id="s2" fx=".8" fy=".5" l:href="#s1"/>
  <radialGradient id="s3" fx=".5" fy=".9" l:href="#s1"/>
  <radialGradient id="s4" fx=".1" fy=".5" l:href="#s1"/>
</defs>
<g stroke="#940">
  <path d="M73,29c-37-40-62-24-52,4l6-7c-8-16,7-26,42,9z" fill="url(#s1)"/>
  <path d="M47,8c33-16,48,21,9,47l-6-5c38-27,20-44,5-37z" fill="url(#s2)"/>
  <path d="M77,32c22,30,10,57-39,51l-1-8c3,3,67,5,36-36z" fill="url(#s3)"/>

  <path d="M58,84c-4,20-38-4-8-24l-6-5c-36,43,15,56,23,27z" fill="url(#s4)"/>
  <path d="M40,14c-40,37-37,52-9,68l1-8c-16-13-29-21,16-56z" fill="url(#s1)"/>
  <path d="M31,33c19,23,20,7,35,41l-9,1.7c-4-19-8-14-31-37z" fill="url(#s2)"/>
</g>
</svg>
</body></html>
EOX
end