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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 918bd8b9313280260ce7648f0f2a178bec9325143ad68aecdabfcf27f21b0b24
4
- data.tar.gz: 6b6ebff0e81aca94b07ee71e81a30d40d9fc2bbf74c1a5a27b9f262a51dd30ef
3
+ metadata.gz: 7ae551e19c600eba6d19a7a2a1c764275673d4ad7deba04d3778d407464ec8b9
4
+ data.tar.gz: e546f3c3290bfde650efb0d42625146abaf87f20741be65aee93ab8dad0a1c84
5
5
  SHA512:
6
- metadata.gz: 30addc534fe9cdd914a4f8e932aafdcfc6b16cf41f1de807b48311a7daee62e2378cfa6ed6cb09609944db41daa2003723432cf944369b69404b1bdf31af481d
7
- data.tar.gz: 070ba5d0faf6ab33330db7e8253310e73b87134a350b7962ddea0bd651cf9286baefaaf7c049b48619848f1449265dc46f6a559751af5c6b911b7d643726f490
6
+ metadata.gz: 30ba4c3744a7742dcde2b457fcfa99a0a32f7ddac8ebd721ca79eff029b0faeb4ab91b8577d4270975973933193594b3ff7e05926e7e84500dee25d20c90ce3b
7
+ data.tar.gz: 12791df8b1c31cc43204904abbe4f7b5e3f3d1e3e4be248637efbb67d734fe6be36f9384a6345be95ba3993efcec43c0f387086d63cafc623d0f63a66c9c69fa
data/lib/moxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Moxml
4
- VERSION = "0.5.135"
4
+ VERSION = "0.5.136"
5
5
  end
@@ -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.135
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