xml_hate 0.8.3 → 0.8.3.1
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.
- data/lib/xml_hate/node.rb +5 -1
- data/lib/xml_hate/version.rb +1 -1
- data/spec/xml_hate/node_spec.rb +5 -1
- metadata +3 -2
data/lib/xml_hate/node.rb
CHANGED
@@ -17,7 +17,11 @@ module XmlHate
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def an_empty_array_for_plurals_or_empty_string_for_singulars(meth)
|
20
|
-
meth.to_s == meth.to_s.pluralize
|
20
|
+
return [] if meth.to_s == meth.to_s.pluralize
|
21
|
+
|
22
|
+
empty_string = ""
|
23
|
+
attempt_to_attach_content_singleton_to_the_value empty_string
|
24
|
+
empty_string
|
21
25
|
end
|
22
26
|
|
23
27
|
def create_accessor_for(k, v)
|
data/lib/xml_hate/version.rb
CHANGED
data/spec/xml_hate/node_spec.rb
CHANGED
@@ -102,10 +102,14 @@ describe XmlHate::Node do
|
|
102
102
|
@object.lastname.must_equal "Wyatt"
|
103
103
|
end
|
104
104
|
|
105
|
-
it "should allow me to
|
105
|
+
it "should allow me to access the value for the string using .content as well" do
|
106
106
|
@object.firstname.content.must_equal "Ellis"
|
107
107
|
@object.lastname.content.must_equal "Wyatt"
|
108
108
|
end
|
109
|
+
|
110
|
+
it "should allow me to access the nonexistent values using .content" do
|
111
|
+
@object.something_else.content.must_equal ""
|
112
|
+
end
|
109
113
|
end
|
110
114
|
|
111
115
|
describe "passing a key with dashes" do
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml_hate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
9
|
- 3
|
10
|
-
|
10
|
+
- 1
|
11
|
+
version: 0.8.3.1
|
11
12
|
platform: ruby
|
12
13
|
authors:
|
13
14
|
- Darren Cauthon
|