xrt 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xrt/statement.rb +4 -1
- data/lib/xrt/version.rb +1 -1
- data/test/test-statement.rb +13 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 522fc466d294244892a5bbc592f6eada3fe5b1fb
|
4
|
+
data.tar.gz: bb90d04bbd0e92f87b6ce9285cd2955eed534874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d3d56352e6f7eae2dc34841c4904d9d9562fef2772cf6cdfef92c41d2780377cd0044d754da1595852fb94113cedb358ed8bb0a046807a62fa1052ff1c871b4
|
7
|
+
data.tar.gz: 6ff6151ddfdc56e96edbd492d860e584c4a03c8baa4acb7d630e1500f3199aa03e80aff932cb0217964be67fa276cc0714880828857afe9c230b58af97ee7493
|
data/lib/xrt/statement.rb
CHANGED
@@ -204,7 +204,10 @@ module XRT
|
|
204
204
|
end
|
205
205
|
|
206
206
|
def tag_name
|
207
|
-
@children
|
207
|
+
return nil if @children.empty?
|
208
|
+
matched = @children[1].content.match(%r{\A/?(\w+)})
|
209
|
+
return nil unless matched
|
210
|
+
return matched[1].downcase
|
208
211
|
end
|
209
212
|
|
210
213
|
def tag_opening?
|
data/lib/xrt/version.rb
CHANGED
data/test/test-statement.rb
CHANGED
@@ -268,6 +268,19 @@ class TestTag < Test::Unit::TestCase
|
|
268
268
|
}
|
269
269
|
end
|
270
270
|
|
271
|
+
def test_tag_name_when_parse_failed
|
272
|
+
tag = XRT::Statement::Tag.new('<')
|
273
|
+
tag << XRT::Statement::Text.new(' 1')
|
274
|
+
tag << XRT::Statement::TagEnd.new('>')
|
275
|
+
assert_equal nil, tag.tag_name
|
276
|
+
end
|
277
|
+
|
278
|
+
def test_tag_name_when_empty_broken_tag
|
279
|
+
tag = XRT::Statement::Tag.new('<')
|
280
|
+
tag << XRT::Statement::TagEnd.new('>')
|
281
|
+
assert_equal nil, tag.tag_name
|
282
|
+
end
|
283
|
+
|
271
284
|
def test_void_element?
|
272
285
|
[
|
273
286
|
['div', false],
|