w3c_validators 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +2 -0
- data/lib/w3c_validators/markup_validator.rb +7 -1
- data/lib/w3c_validators/results.rb +1 -1
- data/test/test_markup_validator.rb +12 -0
- metadata +3 -3
data/README
CHANGED
@@ -113,4 +113,6 @@ between each call to the W3C's validators per their request.
|
|
113
113
|
Documentation and the source code are available at http://code.dunae.ca/w3c_validators.
|
114
114
|
|
115
115
|
Written by Alex Dunae (dunae.ca, e-mail 'code' at the same domain), 2007.
|
116
|
+
|
117
|
+
Thanks to Ryan King (http://theryanking.com/) for creating the 0.9.1 update.
|
116
118
|
|
@@ -183,7 +183,13 @@ protected
|
|
183
183
|
results.add_message(local_type, message_params)
|
184
184
|
end
|
185
185
|
end
|
186
|
-
|
186
|
+
|
187
|
+
doc.elements.each("env:Envelope/env:Body/env:Fault/env:Reason") do |message|
|
188
|
+
message.elements.each("env:Text") do |m|
|
189
|
+
results.add_message(:error, {:mesage => m.text})
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
187
193
|
doc.elements.each("env:Envelope/env:Body/m:markupvalidationresponse/m:debug") do |debug|
|
188
194
|
results.add_debug_message(debug.attribute('name').value, debug.text)
|
189
195
|
end
|
@@ -69,4 +69,16 @@ class MarkupValidatorTests < Test::Unit::TestCase
|
|
69
69
|
assert_equal 0, r.errors.length
|
70
70
|
assert_equal 0, r.warnings.length
|
71
71
|
end
|
72
|
+
|
73
|
+
def test_validator_abort
|
74
|
+
@v.set_debug!
|
75
|
+
assert_nothing_raised do
|
76
|
+
r = @v.validate_uri('http://code.dunae.ca/w3c_validators/test/invalid_encoding.html')
|
77
|
+
assert !r.is_valid?
|
78
|
+
assert_equal 1, r.errors.length
|
79
|
+
assert_equal [], r.warnings
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
|
72
84
|
end
|
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.2
|
3
3
|
specification_version: 1
|
4
4
|
name: w3c_validators
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.9.
|
7
|
-
date:
|
6
|
+
version: 0.9.2
|
7
|
+
date: 2008-02-08 00:00:00 -08:00
|
8
8
|
summary: Wrapper for the World Wide Web Consortium's online validation services.
|
9
9
|
require_paths:
|
10
10
|
- lib
|