moxml 0.5.135 → 0.5.136
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/version.rb +1 -1
- data/spec/moxml/adapter/leptris_strict_mismatch_spec.rb +42 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ae551e19c600eba6d19a7a2a1c764275673d4ad7deba04d3778d407464ec8b9
|
|
4
|
+
data.tar.gz: e546f3c3290bfde650efb0d42625146abaf87f20741be65aee93ab8dad0a1c84
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30ba4c3744a7742dcde2b457fcfa99a0a32f7ddac8ebd721ca79eff029b0faeb4ab91b8577d4270975973933193594b3ff7e05926e7e84500dee25d20c90ce3b
|
|
7
|
+
data.tar.gz: 12791df8b1c31cc43204904abbe4f7b5e3f3d1e3e4be248637efbb67d734fe6be36f9384a6345be95ba3993efcec43c0f387086d63cafc623d0f63a66c9c69fa
|
data/lib/moxml/version.rb
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "spec_helper"
|
|
4
|
+
|
|
5
|
+
# Engine 1.9.355 (leptris#1700) names the tag mismatch in strict-parse
|
|
6
|
+
# failures — "expected </a>, got </b>" instead of the generic
|
|
7
|
+
# "malformed input". moxml passes the binding message through
|
|
8
|
+
# verbatim, so strict callers get the diagnostic for free; the spec
|
|
9
|
+
# pins it so a regression (or a re-genericization upstream) is caught.
|
|
10
|
+
RSpec.describe "leptris strict-parse mismatch diagnostic" do
|
|
11
|
+
let(:ctx) { Moxml.new(:leptris) }
|
|
12
|
+
|
|
13
|
+
context "when the engine names the mismatch (>= 1.9.355.0)" do
|
|
14
|
+
before do
|
|
15
|
+
unless Gem::Version.new(Leptris::VERSION) >= Gem::Version.new("1.9.355.0")
|
|
16
|
+
skip "binding #{Leptris::VERSION} predates the mismatch diagnostic"
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "names expected and got in the raised message" do
|
|
21
|
+
expect do
|
|
22
|
+
ctx.parse("<root><a></b></root>", strict: true)
|
|
23
|
+
end.to raise_error(Moxml::ParseError) do |e|
|
|
24
|
+
expect(e.message).to include("tag mismatch")
|
|
25
|
+
expect(e.message).to include("</a>")
|
|
26
|
+
expect(e.message).to include("</b>")
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
it "reports the byte offset of the failure" do
|
|
31
|
+
expect do
|
|
32
|
+
ctx.parse("<root><a></b></root>", strict: true)
|
|
33
|
+
end.to raise_error(Moxml::ParseError, /byte 13/)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it "still raises Moxml::ParseError on strict parse failure" do
|
|
38
|
+
expect do
|
|
39
|
+
ctx.parse("<root><a></b></root>", strict: true)
|
|
40
|
+
end.to raise_error(Moxml::ParseError)
|
|
41
|
+
end
|
|
42
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moxml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.5.
|
|
4
|
+
version: 0.5.136
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -458,6 +458,7 @@ files:
|
|
|
458
458
|
- spec/moxml/adapter/leptris_sax_dup_attr_spec.rb
|
|
459
459
|
- spec/moxml/adapter/leptris_sax_records_spec.rb
|
|
460
460
|
- spec/moxml/adapter/leptris_spec.rb
|
|
461
|
+
- spec/moxml/adapter/leptris_strict_mismatch_spec.rb
|
|
461
462
|
- spec/moxml/adapter/leptris_xpath_identity_spec.rb
|
|
462
463
|
- spec/moxml/adapter/libxml_internals_spec.rb
|
|
463
464
|
- spec/moxml/adapter/libxml_spec.rb
|