skates 0.2.15 → 0.2.16
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/skates/xmpp_parser.rb +1 -1
- data/spec/lib/skates/xmpp_parser_spec.rb +8 -0
- metadata +2 -2
data/lib/skates/xmpp_parser.rb
CHANGED
@@ -60,7 +60,7 @@ module Skates
|
|
60
60
|
def clear_characters_buffer
|
61
61
|
if @buffer && @elem
|
62
62
|
@buffer.strip!
|
63
|
-
@elem.add_child(Nokogiri::XML::Text.new(
|
63
|
+
@elem.add_child(Nokogiri::XML::Text.new(@buffer, @doc)) unless @buffer.empty?
|
64
64
|
@buffer = nil # empty the buffer
|
65
65
|
end
|
66
66
|
end
|
@@ -55,6 +55,14 @@ describe Skates::XmppParser do
|
|
55
55
|
@parser.characters(chars2)
|
56
56
|
@parser.instance_variable_get("@buffer").should == chars + chars2
|
57
57
|
end
|
58
|
+
|
59
|
+
it "should not parse text content as XML" do
|
60
|
+
stanza = "<message><body>&#187;</body></message>"
|
61
|
+
@parser.push stanza
|
62
|
+
# Not "\273":
|
63
|
+
(@parser.elem / 'message/body')[0].content.should == '»'
|
64
|
+
(@parser.elem / 'message/body').to_xml.should == "<body>&#187;</body>"
|
65
|
+
end
|
58
66
|
end
|
59
67
|
|
60
68
|
describe ".start_element" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skates
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- julien Genestoux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-15 00:00:00 +01:00
|
13
13
|
default_executable: skates
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|