moxml 0.5.109 → 0.5.110
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/element.rb +2 -2
- data/lib/moxml/version.rb +1 -1
- data/spec/moxml/element_attribute_pairs_spec.rb +19 -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: 3982cbbfe581d8786fa674d3ec8dd1f63900530621265baec4d6e2ff03a5791f
|
|
4
|
+
data.tar.gz: 83906c429efb771af92ba8358a0cd67523d52e7d732cf0ab7e2d6edf1f400af0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0459f6ce8ee1713a840295ce951f19950b1f9e9acffa5ff2949b840fef604468897ae59398aae9bd9a3c1ea0c0b0f6ec591e02e7bf4eaf11dae96d56e3864f61'
|
|
7
|
+
data.tar.gz: 1ed691f3d140ea793f6f94ddef4693dab5155cbf9abbf8c2dce227bf828e2ae976bacf9db7b69839d0f8345f31b2aa6991e7ee6c52acf72ae5628e4bd82e8498
|
data/lib/moxml/element.rb
CHANGED
|
@@ -127,8 +127,8 @@ module Moxml
|
|
|
127
127
|
# writes bump it (see invalidate_attribute_value_cache!).
|
|
128
128
|
def attribute_pairs
|
|
129
129
|
generation = attribute_value_generation
|
|
130
|
-
@
|
|
131
|
-
@
|
|
130
|
+
@attribute_pairs = nil if @attribute_pairs_gen != generation
|
|
131
|
+
@attribute_pairs_gen = generation
|
|
132
132
|
@attribute_pairs ||= adapter.attribute_pairs(@native)
|
|
133
133
|
end
|
|
134
134
|
|
data/lib/moxml/version.rb
CHANGED
|
@@ -39,4 +39,23 @@ RSpec.describe Moxml::Element do
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
|
+
|
|
43
|
+
context "when memoized" do
|
|
44
|
+
it "returns the same object on repeated reads" do
|
|
45
|
+
with_adapter(:leptris) do |ctx|
|
|
46
|
+
root = ctx.parse(xml).root
|
|
47
|
+
expect(root.attribute_pairs).to equal(root.attribute_pairs)
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
it "refreshes after a value write" do
|
|
52
|
+
with_adapter(:leptris) do |ctx|
|
|
53
|
+
root = ctx.parse(xml).root
|
|
54
|
+
before = root.attribute_pairs
|
|
55
|
+
root["id"] = "r9"
|
|
56
|
+
expect(root.attribute_pairs).not_to equal(before)
|
|
57
|
+
expect(root.attribute_pairs).to include(["id", "r9"])
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
42
61
|
end
|