markup_validity 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/CHANGELOG.rdoc +10 -0
  2. data/Manifest.txt +88 -0
  3. data/Rakefile +7 -11
  4. data/lib/markup_validity.rb +1 -1
  5. data/lib/markup_validity/MarkUp.html +1095 -0
  6. data/lib/markup_validity/SCHEMA.html +90 -0
  7. data/lib/markup_validity/assertions.rb +8 -1
  8. data/lib/markup_validity/examples.html +25 -0
  9. data/lib/markup_validity/rspec.rb +19 -0
  10. data/lib/markup_validity/templates.html +15 -0
  11. data/lib/markup_validity/validator.rb +27 -1
  12. data/lib/markup_validity/xframes-1.xsd +166 -0
  13. data/lib/markup_validity/xhtml-access-1.xsd +43 -0
  14. data/lib/markup_validity/xhtml-applet-1.xsd +66 -0
  15. data/lib/markup_validity/xhtml-attribs-1.xsd +67 -0
  16. data/lib/markup_validity/xhtml-base-1.xsd +31 -0
  17. data/lib/markup_validity/xhtml-basic-form-1.xsd +195 -0
  18. data/lib/markup_validity/xhtml-basic-table-1.xsd +169 -0
  19. data/lib/markup_validity/xhtml-basic10-model-1.xsd +385 -0
  20. data/lib/markup_validity/xhtml-basic10-module-redefines-1.xsd +61 -0
  21. data/lib/markup_validity/xhtml-basic10-modules-1.xsd +233 -0
  22. data/lib/markup_validity/xhtml-basic10.xsd +99 -0
  23. data/lib/markup_validity/xhtml-basic11-model-1.xsd +622 -0
  24. data/lib/markup_validity/xhtml-basic11-modules-1.xsd +508 -0
  25. data/lib/markup_validity/xhtml-basic11.xsd +105 -0
  26. data/lib/markup_validity/xhtml-bdo-1.xsd +72 -0
  27. data/lib/markup_validity/xhtml-blkphras-1.xsd +155 -0
  28. data/lib/markup_validity/xhtml-blkpres-1.xsd +32 -0
  29. data/lib/markup_validity/xhtml-blkstruct-1.xsd +44 -0
  30. data/lib/markup_validity/xhtml-charent-1.xsd +38 -0
  31. data/lib/markup_validity/xhtml-copyright-1.xsd +29 -0
  32. data/lib/markup_validity/xhtml-csismap-1.xsd +91 -0
  33. data/lib/markup_validity/xhtml-datatypes-1.xsd +177 -0
  34. data/lib/markup_validity/xhtml-edit-1.xsd +34 -0
  35. data/lib/markup_validity/xhtml-events-1.xsd +130 -0
  36. data/lib/markup_validity/xhtml-form-1.xsd +321 -0
  37. data/lib/markup_validity/xhtml-frames-1.xsd +113 -0
  38. data/lib/markup_validity/xhtml-framework-1.xsd +62 -0
  39. data/lib/markup_validity/xhtml-hypertext-1.xsd +47 -0
  40. data/lib/markup_validity/xhtml-iframe-1.xsd +68 -0
  41. data/lib/markup_validity/xhtml-image-1.xsd +40 -0
  42. data/lib/markup_validity/xhtml-inlphras-1.xsd +158 -0
  43. data/lib/markup_validity/xhtml-inlpres-1.xsd +34 -0
  44. data/lib/markup_validity/xhtml-inlstruct-1.xsd +45 -0
  45. data/lib/markup_validity/xhtml-inlstyle-1.xsd +22 -0
  46. data/lib/markup_validity/xhtml-inputmode-1.xsd +35 -0
  47. data/lib/markup_validity/xhtml-lat1.ent +196 -0
  48. data/lib/markup_validity/xhtml-legacy-1.xsd +97 -0
  49. data/lib/markup_validity/xhtml-link-1.xsd +45 -0
  50. data/lib/markup_validity/xhtml-list-1.xsd +94 -0
  51. data/lib/markup_validity/xhtml-meta-1.xsd +54 -0
  52. data/lib/markup_validity/xhtml-metaAttributes-1.xsd +39 -0
  53. data/lib/markup_validity/xhtml-misc-1.xsd +441 -0
  54. data/lib/markup_validity/xhtml-nameident-1.xsd +63 -0
  55. data/lib/markup_validity/xhtml-notations-1.xsd +69 -0
  56. data/lib/markup_validity/xhtml-object-1.xsd +71 -0
  57. data/lib/markup_validity/xhtml-param-1.xsd +46 -0
  58. data/lib/markup_validity/xhtml-pres-1.xsd +46 -0
  59. data/lib/markup_validity/xhtml-print-1.xsd +85 -0
  60. data/lib/markup_validity/xhtml-print-model-1.xsd +604 -0
  61. data/lib/markup_validity/xhtml-print-modules-1.xsd +422 -0
  62. data/lib/markup_validity/xhtml-rdfa-1.dtd +438 -0
  63. data/lib/markup_validity/xhtml-rdfa-1.xsd +116 -0
  64. data/lib/markup_validity/xhtml-rdfa-model-1.xsd +461 -0
  65. data/lib/markup_validity/xhtml-rdfa-modules-1.xsd +548 -0
  66. data/lib/markup_validity/xhtml-ruby-1.xsd +170 -0
  67. data/lib/markup_validity/xhtml-ruby-basic-1.xsd +84 -0
  68. data/lib/markup_validity/xhtml-script-1.xsd +65 -0
  69. data/lib/markup_validity/xhtml-special.ent +80 -0
  70. data/lib/markup_validity/xhtml-ssismap-1.xsd +38 -0
  71. data/lib/markup_validity/xhtml-struct-1.xsd +85 -0
  72. data/lib/markup_validity/xhtml-style-1.xsd +47 -0
  73. data/lib/markup_validity/xhtml-symbol.ent +237 -0
  74. data/lib/markup_validity/xhtml-table-1.xsd +267 -0
  75. data/lib/markup_validity/xhtml-target-1.xsd +49 -0
  76. data/lib/markup_validity/xhtml-text-1.xsd +62 -0
  77. data/lib/markup_validity/xhtml1-strict.dtd +978 -0
  78. data/lib/markup_validity/xhtml1-transitional.dtd +1201 -0
  79. data/lib/markup_validity/xhtml11-model-1.xsd +715 -0
  80. data/lib/markup_validity/xhtml11-module-redefines-1.xsd +335 -0
  81. data/lib/markup_validity/xhtml11-modules-1.xsd +605 -0
  82. data/lib/markup_validity/xhtml11.xsd +107 -0
  83. data/lib/markup_validity/xhtml2.xsd +21 -0
  84. data/lib/markup_validity/xml-events-1.xsd +73 -0
  85. data/lib/markup_validity/xml-events-2.xsd +73 -0
  86. data/lib/markup_validity/xml-events-attribs-1.xsd +73 -0
  87. data/lib/markup_validity/xml-events-attribs-2.xsd +75 -0
  88. data/lib/markup_validity/xml-events-copyright-1.xsd +34 -0
  89. data/lib/markup_validity/xml-events-copyright-2.xsd +34 -0
  90. data/lib/markup_validity/xml-handlers-1.xsd +136 -0
  91. data/lib/markup_validity/xml-handlers-2.xsd +98 -0
  92. data/lib/markup_validity/xml-script-1.xsd +38 -0
  93. data/spec/matcher_spec.rb +8 -0
  94. data/test/assets/invalid_entity.xhtml +109 -0
  95. data/test/assets/invalid_entity_transitional.xhtml +109 -0
  96. data/test/helper.rb +48 -0
  97. data/test/test_markup_validity.rb +19 -0
  98. metadata +90 -3
@@ -27,5 +27,53 @@ module MarkupValidity
27
27
  </html>
28
28
  eoxhtml
29
29
  end
30
+
31
+ # snippets taken from http://www.w3.org/TR/rdfa-syntax/
32
+ def valid_document_xhtml_rdfa
33
+ <<-eoxhtml
34
+ <html
35
+ xmlns="http://www.w3.org/1999/xhtml"
36
+ xmlns:foaf="http://xmlns.com/foaf/0.1/"
37
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
38
+ xmlns:cal="http://www.w3.org/2002/12/cal/ical#"
39
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
40
+ >
41
+ <head>
42
+ <title>My home-page</title>
43
+ <meta property="dc:creator" content="Mark Birbeck" />
44
+ <link rel="foaf:topic" href="http://www.formsPlayer.com/#us" />
45
+ </head>
46
+ <body>
47
+ <div>
48
+ <p>
49
+ I'm holding
50
+ <span property="cal:summary">
51
+ one last summer Barbecue
52
+ </span>,
53
+ on
54
+ <span property="cal:dtstart" content="2007-09-16T16:00:00-05:00"
55
+ datatype="xsd:dateTime">
56
+ September 16th at 4pm
57
+ </span>.
58
+ </p>
59
+
60
+ <a xmlns:cc="http://creativecommons.org/ns#"
61
+ rel="cc:license"
62
+ href="http://creativecommons.org/licenses/by-nc-nd/3.0/">
63
+ Creative Commons License
64
+ </a>.
65
+ </div>
66
+ </body>
67
+ </html>
68
+ eoxhtml
69
+ end
70
+
71
+ def invalid_entity_document
72
+ File.read(File.join(File.dirname(__FILE__), 'assets', 'invalid_entity.xhtml'))
73
+ end
74
+
75
+ def invalid_entity_document_transitional
76
+ File.read(File.join(File.dirname(__FILE__), 'assets', 'invalid_entity_transitional.xhtml'))
77
+ end
30
78
  end
31
79
  end
@@ -23,6 +23,14 @@ class TestMarkupValidity < Test::Unit::TestCase
23
23
  @fu = FakeUnit.new
24
24
  end
25
25
 
26
+ def test_strict_invalid_entity_error
27
+ assert_xhtml_strict invalid_entity_document
28
+ end
29
+
30
+ def test_transitional_invalid_entity_error
31
+ assert_xhtml_transitional invalid_entity_document_transitional
32
+ end
33
+
26
34
  def test_line_numbers_do_not_roll_over
27
35
  validator = MarkupValidity::Validator.new('foo')
28
36
  assert !validator.valid?
@@ -51,6 +59,11 @@ class TestMarkupValidity < Test::Unit::TestCase
51
59
  assert_equal [true, ''], @fu.assertions.first
52
60
  end
53
61
 
62
+ def test_valid_xhtml_rdfa
63
+ @fu.assert_xhtml_rdfa valid_document_xhtml_rdfa
64
+ assert_equal [true, ''], @fu.assertions.first
65
+ end
66
+
54
67
  def test_invalid_xhtml
55
68
  @fu.assert_xhtml_transitional invalid_document
56
69
  assert_equal false, @fu.assertions.first.first
@@ -63,6 +76,12 @@ class TestMarkupValidity < Test::Unit::TestCase
63
76
  assert_match('Missing child element', @fu.assertions.first.last)
64
77
  end
65
78
 
79
+ def test_invalid_xhtml_rdfa
80
+ @fu.assert_xhtml_rdfa invalid_document
81
+ assert_equal false, @fu.assertions.first.first
82
+ assert_match('Missing child element', @fu.assertions.first.last)
83
+ end
84
+
66
85
  def test_valid_schema
67
86
  xsd = File.join(File.dirname(__FILE__), 'assets', 'shipment.xsd')
68
87
  xml = File.join(File.dirname(__FILE__), 'assets', 'order.xml')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markup_validity
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Patterson
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-12 00:00:00 -07:00
12
+ date: 2009-08-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 2.3.2
34
34
  version:
35
35
  description: |-
36
36
  MarkupValidity provides test/unit and rspec helpers for checking the validity
@@ -55,13 +55,100 @@ files:
55
55
  - README.rdoc
56
56
  - Rakefile
57
57
  - lib/markup_validity.rb
58
+ - lib/markup_validity/MarkUp.html
59
+ - lib/markup_validity/SCHEMA.html
58
60
  - lib/markup_validity/assertions.rb
61
+ - lib/markup_validity/examples.html
59
62
  - lib/markup_validity/rspec.rb
63
+ - lib/markup_validity/templates.html
60
64
  - lib/markup_validity/validator.rb
65
+ - lib/markup_validity/xframes-1.xsd
66
+ - lib/markup_validity/xhtml-access-1.xsd
67
+ - lib/markup_validity/xhtml-applet-1.xsd
68
+ - lib/markup_validity/xhtml-attribs-1.xsd
69
+ - lib/markup_validity/xhtml-base-1.xsd
70
+ - lib/markup_validity/xhtml-basic-form-1.xsd
71
+ - lib/markup_validity/xhtml-basic-table-1.xsd
72
+ - lib/markup_validity/xhtml-basic10-model-1.xsd
73
+ - lib/markup_validity/xhtml-basic10-module-redefines-1.xsd
74
+ - lib/markup_validity/xhtml-basic10-modules-1.xsd
75
+ - lib/markup_validity/xhtml-basic10.xsd
76
+ - lib/markup_validity/xhtml-basic11-model-1.xsd
77
+ - lib/markup_validity/xhtml-basic11-modules-1.xsd
78
+ - lib/markup_validity/xhtml-basic11.xsd
79
+ - lib/markup_validity/xhtml-bdo-1.xsd
80
+ - lib/markup_validity/xhtml-blkphras-1.xsd
81
+ - lib/markup_validity/xhtml-blkpres-1.xsd
82
+ - lib/markup_validity/xhtml-blkstruct-1.xsd
83
+ - lib/markup_validity/xhtml-charent-1.xsd
84
+ - lib/markup_validity/xhtml-copyright-1.xsd
85
+ - lib/markup_validity/xhtml-csismap-1.xsd
86
+ - lib/markup_validity/xhtml-datatypes-1.xsd
87
+ - lib/markup_validity/xhtml-edit-1.xsd
88
+ - lib/markup_validity/xhtml-events-1.xsd
89
+ - lib/markup_validity/xhtml-form-1.xsd
90
+ - lib/markup_validity/xhtml-frames-1.xsd
91
+ - lib/markup_validity/xhtml-framework-1.xsd
92
+ - lib/markup_validity/xhtml-hypertext-1.xsd
93
+ - lib/markup_validity/xhtml-iframe-1.xsd
94
+ - lib/markup_validity/xhtml-image-1.xsd
95
+ - lib/markup_validity/xhtml-inlphras-1.xsd
96
+ - lib/markup_validity/xhtml-inlpres-1.xsd
97
+ - lib/markup_validity/xhtml-inlstruct-1.xsd
98
+ - lib/markup_validity/xhtml-inlstyle-1.xsd
99
+ - lib/markup_validity/xhtml-inputmode-1.xsd
100
+ - lib/markup_validity/xhtml-lat1.ent
101
+ - lib/markup_validity/xhtml-legacy-1.xsd
102
+ - lib/markup_validity/xhtml-link-1.xsd
103
+ - lib/markup_validity/xhtml-list-1.xsd
104
+ - lib/markup_validity/xhtml-meta-1.xsd
105
+ - lib/markup_validity/xhtml-metaAttributes-1.xsd
106
+ - lib/markup_validity/xhtml-misc-1.xsd
107
+ - lib/markup_validity/xhtml-nameident-1.xsd
108
+ - lib/markup_validity/xhtml-notations-1.xsd
109
+ - lib/markup_validity/xhtml-object-1.xsd
110
+ - lib/markup_validity/xhtml-param-1.xsd
111
+ - lib/markup_validity/xhtml-pres-1.xsd
112
+ - lib/markup_validity/xhtml-print-1.xsd
113
+ - lib/markup_validity/xhtml-print-model-1.xsd
114
+ - lib/markup_validity/xhtml-print-modules-1.xsd
115
+ - lib/markup_validity/xhtml-rdfa-1.dtd
116
+ - lib/markup_validity/xhtml-rdfa-1.xsd
117
+ - lib/markup_validity/xhtml-rdfa-model-1.xsd
118
+ - lib/markup_validity/xhtml-rdfa-modules-1.xsd
119
+ - lib/markup_validity/xhtml-ruby-1.xsd
120
+ - lib/markup_validity/xhtml-ruby-basic-1.xsd
121
+ - lib/markup_validity/xhtml-script-1.xsd
122
+ - lib/markup_validity/xhtml-special.ent
123
+ - lib/markup_validity/xhtml-ssismap-1.xsd
124
+ - lib/markup_validity/xhtml-struct-1.xsd
125
+ - lib/markup_validity/xhtml-style-1.xsd
126
+ - lib/markup_validity/xhtml-symbol.ent
127
+ - lib/markup_validity/xhtml-table-1.xsd
128
+ - lib/markup_validity/xhtml-target-1.xsd
129
+ - lib/markup_validity/xhtml-text-1.xsd
130
+ - lib/markup_validity/xhtml1-strict.dtd
61
131
  - lib/markup_validity/xhtml1-strict.xsd
132
+ - lib/markup_validity/xhtml1-transitional.dtd
62
133
  - lib/markup_validity/xhtml1-transitional.xsd
134
+ - lib/markup_validity/xhtml11-model-1.xsd
135
+ - lib/markup_validity/xhtml11-module-redefines-1.xsd
136
+ - lib/markup_validity/xhtml11-modules-1.xsd
137
+ - lib/markup_validity/xhtml11.xsd
138
+ - lib/markup_validity/xhtml2.xsd
139
+ - lib/markup_validity/xml-events-1.xsd
140
+ - lib/markup_validity/xml-events-2.xsd
141
+ - lib/markup_validity/xml-events-attribs-1.xsd
142
+ - lib/markup_validity/xml-events-attribs-2.xsd
143
+ - lib/markup_validity/xml-events-copyright-1.xsd
144
+ - lib/markup_validity/xml-events-copyright-2.xsd
145
+ - lib/markup_validity/xml-handlers-1.xsd
146
+ - lib/markup_validity/xml-handlers-2.xsd
147
+ - lib/markup_validity/xml-script-1.xsd
63
148
  - lib/markup_validity/xml.xsd
64
149
  - spec/matcher_spec.rb
150
+ - test/assets/invalid_entity.xhtml
151
+ - test/assets/invalid_entity_transitional.xhtml
65
152
  - test/assets/order.xml
66
153
  - test/assets/shipment.xsd
67
154
  - test/helper.rb