moxml 0.5.122 → 0.5.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/moxml/adapter/leptris.rb +6 -3
- data/lib/moxml/version.rb +1 -1
- data/spec/moxml/xsd_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aba5868bf7db2136823ceac2c98f825cad89b1c8f7b8e34d9ac1de2c7cbe1e61
|
|
4
|
+
data.tar.gz: 3b8cdeb8e497d73d0c2d7db37c5f3af95e5a7bc165a6cbad8a68bb2b3cec2913
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 92aabda5d25c00d5c2d81fa3103ad4580f1e6774827057541659000cb3344e1e056cd922d4ce96a04975d6c29692fa087948a31c41de7d60cd5227f77aff382b
|
|
7
|
+
data.tar.gz: 28cfbef33282d28a6eb0f94c248cbf36399cb8911430b468f9c67f890e2be684d8926d2670c346f54ab7aad9cfb0085f87bfc09dbeb9fed83c8b029e79997134
|
|
@@ -279,14 +279,17 @@ module Moxml
|
|
|
279
279
|
|
|
280
280
|
def xsd_validate(xsd_handle, native_document)
|
|
281
281
|
# +xsd_handle+ is the binding's Leptris::XML::XSD::Schema;
|
|
282
|
-
# validate_errors takes the binding document
|
|
283
|
-
# the
|
|
282
|
+
# validate_errors takes the binding document. Entries
|
|
283
|
+
# normalize to Strings: the moxml contract is []-of-
|
|
284
|
+
# messages, and the binding may enrich entries into
|
|
285
|
+
# structured objects (element/line/column —
|
|
286
|
+
# leptris-ruby#419) without breaking consumers.
|
|
284
287
|
doc = if native_document.is_a?(::Leptris::XML::Document)
|
|
285
288
|
native_document
|
|
286
289
|
else
|
|
287
290
|
to_binding(native_document)
|
|
288
291
|
end
|
|
289
|
-
xsd_handle.validate_errors(doc)
|
|
292
|
+
xsd_handle.validate_errors(doc).map(&:to_s)
|
|
290
293
|
end
|
|
291
294
|
|
|
292
295
|
def builder_face(native_document)
|
data/lib/moxml/version.rb
CHANGED
data/spec/moxml/xsd_spec.rb
CHANGED
|
@@ -123,6 +123,13 @@ RSpec.describe Moxml::XSD do
|
|
|
123
123
|
expect(schema.instance_variable_get(:@parsed_source)).to be_nil
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
+
it "normalizes validate entries to strings (moxml contract)" do
|
|
127
|
+
schema = ctx.xsd(schema_text)
|
|
128
|
+
errors = schema.validate("<note><wrong/></note>")
|
|
129
|
+
expect(errors).not_to be_empty
|
|
130
|
+
expect(errors).to all(be_a(String))
|
|
131
|
+
end
|
|
132
|
+
|
|
126
133
|
it "derives XSD_SUPPORTED from the engine face gate" do
|
|
127
134
|
# The capability flag must not outrun the engine faces: a
|
|
128
135
|
# misreleased lockstep (NATIVE_PLAN_STRUCTS lesson) would arm
|