skates 0.5.0 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,222 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../spec_helper'
2
- require File.dirname(__FILE__) + '/../../em_mock'
3
-
4
- describe Skates::XmppConnection do
5
-
6
- include SkatesSpecHelper
7
-
8
- before(:each) do
9
- @params = {"jid" => "jid@server", "password" => "password", "port" => 1234, "host" => "myhost.com"}
10
- @connection = Skates::XmppConnection._connect(@params, handler_mock)
11
- end
12
-
13
- describe "_connect" do
14
- it "should connect EventMachine and return it" do
15
- EventMachine.should_receive(:connect).with(@params["host"], @params["port"], Skates::XmppConnection, hash_including("handler" => handler_mock)).and_return(@connection)
16
- Skates::XmppConnection._connect(@params, handler_mock).should == @connection
17
- end
18
-
19
- it "should rescue Connection Errors" do
20
- EventMachine.stub!(:connect).with(@params["host"], @params["port"], Skates::XmppConnection, hash_including("handler" => handler_mock)).and_raise(RuntimeError)
21
- lambda {
22
- Skates::XmppConnection._connect(@params, handler_mock)
23
- }.should raise_error(Skates::NotConnected)
24
- end
25
-
26
- end
27
-
28
- describe "connect" do
29
- describe "connect" do
30
- it "should not try to resolve the dns if a host IP has been provided" do
31
- @params["host"] = "123.123.123.123"
32
- Skates::XmppConnection.should_not_receive(:resolve)
33
- Skates::XmppConnection.connect(@params, handler_mock)
34
- end
35
-
36
- describe "when a host is provided, which is not an IP" do
37
- it "should resolve it" do
38
- @params["host"] = "domain.tld"
39
- Skates::XmppConnection.should_receive(:resolve)
40
- Skates::XmppConnection.connect(@params, handler_mock)
41
- end
42
- end
43
-
44
- describe "when no host is provided, and no port either" do
45
- it "should resolve the host to an IP" do
46
- Skates::XmppConnection.should_receive(:resolve)
47
- Skates::XmppConnection.connect(@params, handler_mock)
48
- end
49
- end
50
- end
51
- end
52
-
53
- describe "initialize" do
54
- it "should assign @connected to false" do
55
- @connection.instance_variable_get("@connected").should be_false
56
- end
57
-
58
- it "should assign @jid to params['jid']" do
59
- @connection.instance_variable_get("@jid").should == @params["jid"]
60
- end
61
-
62
- it "should assign @password to params['password']" do
63
- @connection.instance_variable_get("@password").should == @params["password"]
64
- end
65
-
66
- it "should assign @host to params['host']" do
67
- @connection.instance_variable_get("@host").should == @params["host"]
68
- end
69
-
70
- it "should assign @port to params['port']" do
71
- @connection.instance_variable_get("@port").should == @params["port"]
72
- end
73
-
74
- it "should assign @handler to params['handler']" do
75
- @connection.instance_variable_get("@handler").should == handler_mock
76
- end
77
-
78
- it "should assign @buffer to ''" do
79
- @connection.instance_variable_get("@buffer").should == ""
80
- end
81
- end
82
-
83
- describe "post_init" do
84
- it "assigne a new parser" do
85
- parser = Skates::XmppParser.new(@connection.method(:receive_stanza))
86
- Skates::XmppParser.should_receive(:new).and_return(parser)
87
- @connection.post_init
88
- @connection.instance_variable_get("@parser").should == parser
89
- end
90
- end
91
-
92
- describe "connection_completed" do
93
- it "should set @connected to true" do
94
- @connection.connection_completed
95
- @connection.instance_variable_get("@connected").should be_true
96
- end
97
- end
98
-
99
- describe "unbind" do
100
- it "should set @connected to false" do
101
- @connection.connection_completed
102
- @connection.unbind
103
- @connection.instance_variable_get("@connected").should be_false
104
- end
105
- end
106
-
107
- describe "receive_stanza" do
108
-
109
- before(:each) do
110
- @doc = Nokogiri::XML::Document.new
111
- end
112
-
113
- describe "with an stanza that starts with stream:error" do
114
-
115
- before(:each) do
116
- @error_stanza = Nokogiri::XML::Node.new("stream:error", @doc)
117
- end
118
-
119
- it "should close the connection" do
120
- @connection.should_receive(:close_connection)
121
- @connection.receive_stanza(@error_stanza)
122
- end
123
-
124
- describe "with a malformed stanza error" do
125
- before(:each) do
126
- @xml_not_well_formed_stanza = Nokogiri::XML::Node.new("xml-not-well-formed", @doc)
127
- @xml_not_well_formed_stanza.add_namespace("xmlns", "urn:ietf:params:xml:ns:xmpp-streams")
128
- @error_stanza.add_child(@xml_not_well_formed_stanza)
129
- end
130
-
131
- end
132
- end
133
-
134
- describe "with a stanza that is not an error" do
135
- it "should call the on_stanza block" do
136
- stanza = Nokogiri::XML::Node.new("message", @doc)
137
- handler_mock.should_receive(:on_stanza)
138
- @connection.receive_stanza(stanza)
139
- end
140
- end
141
-
142
- end
143
-
144
- describe "send_chunk" do
145
- it "should raise an error if not connected" do
146
- @connection.instance_variable_set("@connected", false)
147
- lambda {
148
- @connection.__send__(:send_chunk, "hello world")
149
- }.should raise_error(Skates::NotConnected)
150
- end
151
-
152
- it "should raise an error if the stanza size is above the limit" do
153
- @connection.instance_variable_set("@connected", true)
154
- string = "a" * (Skates::XmppConnection.max_stanza_size + 1)
155
- lambda {
156
- @connection.__send__(:send_chunk, string)
157
- }.should raise_error(Skates::StanzaTooBig)
158
- end
159
-
160
- it "should return if the string is blank" do
161
- @connection.instance_variable_set("@connected", true)
162
- @connection.should_not_receive(:send_data)
163
- @connection.__send__(:send_chunk, "")
164
- end
165
-
166
- it "should cann send_data with the string" do
167
- @connection.instance_variable_set("@connected", true)
168
- string = "hello world"
169
- @connection.should_receive(:send_data).with(string)
170
- @connection.__send__(:send_chunk, string)
171
- end
172
-
173
- end
174
-
175
- describe "send_xml" do
176
-
177
- before(:each) do
178
- @connection.instance_variable_set("@connected", true)
179
- @connection.stub!(:send_chunk).and_return(true)
180
- @doc = Nokogiri::XML::Document.new
181
- end
182
-
183
- describe "with a nodeset as argument" do
184
- before(:each) do
185
- iq = Nokogiri::XML::Node.new("iq", @doc)
186
- message = Nokogiri::XML::Node.new("message", @doc)
187
- presence = Nokogiri::XML::Node.new("presence", @doc)
188
- @node_set = Nokogiri::XML::NodeSet.new(@doc, [message, presence, iq])
189
- end
190
-
191
- it "should call send_chunk for each of the nodes in the set" do
192
- @node_set.each do |node|
193
- @connection.should_receive(:send_chunk).with(node.to_s)
194
- end
195
- @connection.send_xml(@node_set)
196
- end
197
- end
198
-
199
- describe "with an argument with is not a NodeSet" do
200
- before(:each) do
201
- @message = Nokogiri::XML::Node.new("message", @doc)
202
- end
203
- it "should call send_chunk for the node" do
204
- @connection.should_receive(:send_chunk).with(@message.to_s)
205
- @connection.send_xml(@message)
206
- end
207
- end
208
- end
209
-
210
- describe "receive_data" do
211
- before(:each) do
212
- @connection.instance_variable_get("@parser").stub!(:push).and_return(true)
213
- end
214
-
215
- it "should push the received data to the parser" do
216
- data = "<hello>hello world!</hello>"
217
- @connection.instance_variable_get("@parser").should_receive(:push).with(data).and_return(true)
218
- @connection.__send__(:receive_data, data)
219
- end
220
- end
221
-
222
- end
@@ -1,469 +0,0 @@
1
- $: << "." # Adding the local directory to the path, so we can safely require models, controllers and views.
2
- require File.dirname(__FILE__) + '/../../spec_helper'
3
-
4
- describe Skates::XmppParser do
5
-
6
- before(:each) do
7
- @last_stanza = ""
8
- @proc = mock(Proc, :call => true)
9
- @parser = Skates::XmppParser.new(@proc)
10
- end
11
-
12
- describe ".reset" do
13
- it "should reset the document to nil" do
14
- @parser.reset
15
- @parser.elem.should be_nil
16
- end
17
-
18
- it "should reset the element to nil (no element is being parsed)" do
19
- @parser.reset
20
- @parser.elem.should be_nil
21
- end
22
-
23
- it "should reset the parser to a parser" do
24
- new_parser = Nokogiri::XML::SAX::PushParser.new(@parser, "UTF-8")
25
- Nokogiri::XML::SAX::PushParser.should_receive(:new).with(@parser, "UTF-8").and_return(new_parser)
26
- @parser.reset
27
- @parser.parser.should == new_parser
28
- end
29
- end
30
-
31
- describe ".push" do
32
- it "should send the data to the parser" do
33
- data = "<name>me</name>"
34
- @parser.parser.should_receive(:<<).with(data)
35
- @parser.push(data)
36
- end
37
- end
38
-
39
- describe ".characters" do
40
- before(:each) do
41
- @parser.doc = Nokogiri::XML::Document.new
42
- @parser.elem = Nokogiri::XML::Element.new("element", @parser.doc)
43
- end
44
-
45
- it "should add the characters to the buffer" do
46
- chars = "hello my name is julien"
47
- @parser.characters(chars)
48
- @parser.instance_variable_get("@buffer").should == chars
49
- end
50
-
51
- it "should concatenate the text if we receive in both pieces" do
52
- chars = "hello my name is julien"
53
- @parser.characters(chars)
54
- @parser.instance_variable_get("@buffer").should == chars
55
- chars2 = "and I'm french!"
56
- @parser.characters(chars2)
57
- @parser.instance_variable_get("@buffer").should == chars + chars2
58
- end
59
-
60
- it "should not parse text content as XML" do
61
- stanza = "<message><body>&amp;#187;</body></message>"
62
- @parser.push stanza
63
- # Not "\273":
64
- (@parser.elem / 'message/body')[0].content.should == '&#187;'
65
- (@parser.elem / 'message/body').to_xml.should == "<body>&amp;#187;</body>"
66
- end
67
- end
68
-
69
- describe ".start_element" do
70
-
71
- before(:each) do
72
- @new_elem_name = "new"
73
- @new_elem_attributes = [["to", "you@yourserver.com/home"], ["xmlns", "http://ns.com"]]
74
- end
75
-
76
- it "should create a new doc if we don't have one" do
77
- new_doc = Nokogiri::XML::Document.new
78
- @parser.doc = nil
79
- Nokogiri::XML::Document.should_receive(:new).and_return(new_doc)
80
- @parser.start_element(@new_elem_name, @new_elem_attributes)
81
- @parser.doc.should == new_doc
82
- end
83
-
84
- it "should not create a new doc we already have one" do
85
- @parser.doc = Nokogiri::XML::Document.new
86
- Nokogiri::XML::Document.should_not_receive(:new)
87
- @parser.start_element(@new_elem_name, @new_elem_attributes)
88
- end
89
-
90
- it "should create a new element" do
91
- @doc = Nokogiri::XML::Document.new
92
- @parser.doc = @doc
93
- @new_elem = Nokogiri::XML::Element.new(@new_elem_name, @parser.doc)
94
- Nokogiri::XML::Element.should_receive(:new).and_return(@new_elem)
95
- @parser.start_element(@new_elem_name, @new_elem_attributes)
96
- end
97
-
98
- it "should add the new element as a child to the current element if there is one" do
99
- @doc = Nokogiri::XML::Document.new
100
- @parser.doc = @doc
101
- @current = Nokogiri::XML::Element.new("element", @parser.doc)
102
- @parser.elem = @current
103
- @new_elem = Nokogiri::XML::Element.new(@new_elem_name, @parser.doc)
104
- Nokogiri::XML::Element.stub!(:new).and_return(@new_elem)
105
- @parser.start_element(@new_elem_name, @new_elem_attributes)
106
- @new_elem.parent.should == @current
107
- end
108
-
109
- it "should add the new element as the child of the doc if there is none" do
110
- @doc = Nokogiri::XML::Document.new
111
- @parser.doc = @doc
112
- @new_elem = Nokogiri::XML::Element.new(@new_elem_name, @parser.doc)
113
- Nokogiri::XML::Element.stub!(:new).and_return(@new_elem)
114
- @parser.start_element(@new_elem_name, @new_elem_attributes)
115
- @new_elem.parent.should == @doc
116
- end
117
-
118
- it "should add the right attributes and namespaces to the newly created element" do
119
- @parser.start_element(@new_elem_name, @new_elem_attributes)
120
- @parser.elem["to"].should == "you@yourserver.com/home"
121
- @parser.elem.namespaces.should == {"xmlns"=>"http://ns.com"}
122
- end
123
-
124
- describe "when the new element is of name stream:stream" do
125
- it "should callback" do
126
- @proc.should_receive(:call)
127
- @parser.start_element("stream:stream", [])
128
- end
129
-
130
- it "should reinit to nil the doc and the elem" do
131
- @parser.start_element("stream:stream", [])
132
- @parser.doc.should == nil
133
- @parser.elem.should == nil
134
- end
135
- end
136
- end
137
-
138
- describe ".end_element" do
139
- before(:each) do
140
- @doc = Nokogiri::XML::Document.new
141
- @parser.doc = @doc
142
- @current = Nokogiri::XML::Element.new("element", @parser.doc)
143
- @parser.elem = @current
144
- end
145
-
146
- it "should add the content of the buffer to the @elem" do
147
- @elem = Nokogiri::XML::Element.new("element", @parser.doc)
148
- chars = "hello world"
149
- @parser.instance_variable_set("@buffer", chars)
150
- @parser.elem = @elem
151
- @parser.end_element("element")
152
- @elem.content.should == chars
153
- end
154
-
155
- describe "when we're finishing the doc's root" do
156
- before(:each) do
157
- @parser.doc.root = @current
158
- end
159
-
160
- it "should callback" do
161
- @proc.should_receive(:call)
162
- @parser.end_element("element")
163
- end
164
-
165
- it "should reinit to nil the doc and the elem" do
166
- @parser.end_element("element")
167
- @parser.doc.should == nil
168
- @parser.elem.should == nil
169
- end
170
- end
171
-
172
- describe "when we're finishing another element" do
173
- before(:each) do
174
- @parser.doc.root = Nokogiri::XML::Element.new("root", @parser.doc)
175
- @current.parent = @parser.doc.root
176
- end
177
-
178
- it "should go back up one level" do
179
- @parser.end_element("element")
180
- @parser.elem = @current.parent
181
- end
182
- end
183
- end
184
-
185
- describe "a communication with an XMPP Client" do
186
-
187
- before(:each) do
188
- @stanzas = []
189
- @proc = Proc.new { |stanza|
190
- @stanzas << stanza
191
- }
192
- @parser = Skates::XmppParser.new(@proc)
193
- end
194
-
195
- it "should parse the right information" do
196
- string = "<stream:stream
197
- xmlns:stream='http://etherx.jabber.org/streams'
198
- xmlns='jabber:component:accept'
199
- from='plays.shakespeare.lit'
200
- id='3BF96D32'>
201
- <handshake/>
202
- <message from='juliet@example.com'
203
- to='romeo@example.net'
204
- xml:lang='en'>
205
- <body>Art thou not Romeo, and a Montague?</body>
206
- <link href='http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&amp;minAsk=min&amp;maxAsk=max&amp;format=rss&amp;format=rss' />
207
- </message>"
208
- pieces = rand(string.size/30)
209
- # So we have to pick 'pieces' number between 0 and string.size
210
- indices = []
211
- pieces.times do |i|
212
- indices[i] = rand(string.size)
213
- end
214
- # Now let's sort indices
215
- indices.sort!
216
- substrings = []
217
- prev_index = 0
218
- indices.each do |index|
219
- substrings << string[prev_index, (index-prev_index)]
220
- prev_index = index
221
- end
222
- substrings << string[prev_index, string.size]
223
- #Just to make sure we split the string the right way!
224
- substrings.join("").should == string
225
-
226
- substrings.each do |s|
227
- @parser.push(s)
228
- end
229
-
230
- @stanzas.map(&:to_xml).join("").should == "<stream xmlns:stream=\"http://etherx.jabber.org/streams\" xmlns=\"jabber:component:accept\" from=\"plays.shakespeare.lit\" id=\"3BF96D32\"/><handshake/><message from=\"juliet@example.com\" to=\"romeo@example.net\" xml:lang=\"en\">\n <body>Art thou not Romeo, and a Montague?</body>\n <link href=\"http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&amp;minAsk=min&amp;maxAsk=max&amp;format=rss&amp;format=rss\"/>\n</message>"
231
- @stanzas.last.at("link")["href"].should == "http://sfbay.craigslist.org/search/sss?query=%2522mac+mini%2522+Intel+Core+Duo&minAsk=min&maxAsk=max&format=rss&format=rss"
232
- end
233
-
234
- end
235
-
236
- describe "when parsing a complex stanza" do
237
- before(:each) do
238
- @xml =<<-EOXML
239
- <iq id="pub-296" to="test-track.superfeedr.com" type="set">
240
- <feed xmlns="http://superfeedr.com/xmpp-superfeedr-ext" id="368">
241
- <url>http://superfeedr.com/dummy.xml</url>
242
- <http_code>200</http_code>
243
- <etag>"eb8dfc6fa342dc8326851907efe35cda"</etag>
244
- <number_of_new_entries>10</number_of_new_entries>
245
- <last_error_message>7462B in 1.036602s, 10/10 new entries</last_error_message>
246
- <last_fetch>2011-02-21T14:34:52-05:00</last_fetch>
247
- <next_fetch>2011-02-21T14:38:37-05:00</next_fetch>
248
- <period>225</period>
249
- <last_maintenance_at>2011-02-21T14:34:52-05:00</last_maintenance_at>
250
- <entries_count>10</entries_count>
251
- <perform_maintenance>true</perform_maintenance>
252
- <title>The Dummy Time Feed</title>
253
- <format>feed</format>
254
- <link href="http://superfeedr.com" rel="alternate" type="text/html"/>
255
- <link href="http://superfeedr.com/dummy.xml" rel="self" type="application/atom+xml"/>
256
- <last_parse>2011-02-21T14:34:52-05:00</last_parse>
257
- <headers>
258
- <server>nginx/0.8.52</server>
259
- <date>Mon, 21 Feb 2011 19:35:41 GMT</date>
260
- <content_type>application/xml; charset=utf-8</content_type>
261
- <connection>close</connection>
262
- <status>200 OK</status>
263
- <etag>"eb8dfc6fa342dc8326851907efe35cda"</etag>
264
- <x_runtime>858</x_runtime>
265
- <content_length>7462</content_length>
266
- <set_cookie/>
267
- <cache_control>private, max-age=0, must-revalidate</cache_control>
268
- </headers>
269
- <id>tag:superfeedr.com,2005:/hubbub/dummy</id>
270
- </feed>
271
- <pubsub xmlns="http://jabber.org/protocol/pubsub">
272
- <publish node="368">
273
- <item>
274
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
275
- <id>tag:superfeedr.com,2005:String/1298307758</id>
276
- <published>2011-02-21T12:02:38-05:00</published>
277
- <updated>2011-02-21T12:02:38-05:00</updated>
278
- <title>17:02:38</title>
279
- <summary type="text"/>
280
- <content type="text">Monday February 21 17:02:38 UTC 2011 Somebody wanted to know what time it was.</content>
281
- <geo:point>37.773721,-122.414957</geo:point>
282
- <link href="http://superfeedr.com/?1298307758" title="17:02:38" rel="alternate" type="text/html"/>
283
- <category term="tests"/>
284
- <author>
285
- <name>Superfeedr</name>
286
- <uri>http://superfeedr.com/</uri>
287
- <email>julien@superfeedr.com</email>
288
- </author>
289
- </entry>
290
- </item>
291
- <item>
292
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
293
- <id>tag:superfeedr.com,2005:String/1298307618</id>
294
- <published>2011-02-21T12:00:18-05:00</published>
295
- <updated>2011-02-21T12:00:18-05:00</updated>
296
- <title>17:00:18</title>
297
- <summary type="text"/>
298
- <content type="text">Monday February 21 17:00:18 UTC 2011 Somebody wanted to know what time it was.</content>
299
- <geo:point>37.773721,-122.414957</geo:point>
300
- <link href="http://superfeedr.com/?1298307618" title="17:00:18" rel="alternate" type="text/html"/>
301
- <category term="tests"/>
302
- <author>
303
- <name>Superfeedr</name>
304
- <uri>http://superfeedr.com/</uri>
305
- <email>julien@superfeedr.com</email>
306
- </author>
307
- </entry>
308
- </item>
309
- <item>
310
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
311
- <id>tag:superfeedr.com,2005:String/1298307454</id>
312
- <published>2011-02-21T11:57:34-05:00</published>
313
- <updated>2011-02-21T11:57:34-05:00</updated>
314
- <title>16:57:34</title>
315
- <summary type="text"/>
316
- <content type="text">Monday February 21 16:57:34 UTC 2011 Somebody wanted to know what time it was.</content>
317
- <geo:point>37.773721,-122.414957</geo:point>
318
- <link href="http://superfeedr.com/?1298307454" title="16:57:34" rel="alternate" type="text/html"/>
319
- <category term="tests"/>
320
- <author>
321
- <name>Superfeedr</name>
322
- <uri>http://superfeedr.com/</uri>
323
- <email>julien@superfeedr.com</email>
324
- </author>
325
- </entry>
326
- </item>
327
- <item>
328
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
329
- <id>tag:superfeedr.com,2005:String/1298307099</id>
330
- <published>2011-02-21T11:51:39-05:00</published>
331
- <updated>2011-02-21T11:51:39-05:00</updated>
332
- <title>16:51:39</title>
333
- <summary type="text"/>
334
- <content type="text">Monday February 21 16:51:39 UTC 2011 Somebody wanted to know what time it was.</content>
335
- <geo:point>37.773721,-122.414957</geo:point>
336
- <link href="http://superfeedr.com/?1298307099" title="16:51:39" rel="alternate" type="text/html"/>
337
- <category term="tests"/>
338
- <author>
339
- <name>Superfeedr</name>
340
- <uri>http://superfeedr.com/</uri>
341
- <email>julien@superfeedr.com</email>
342
- </author>
343
- </entry>
344
- </item>
345
- <item>
346
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
347
- <id>tag:superfeedr.com,2005:String/1298305317</id>
348
- <published>2011-02-21T11:21:57-05:00</published>
349
- <updated>2011-02-21T11:21:57-05:00</updated>
350
- <title>16:21:57</title>
351
- <summary type="text"/>
352
- <content type="text">Monday February 21 16:21:57 UTC 2011 Somebody wanted to know what time it was.</content>
353
- <geo:point>37.773721,-122.414957</geo:point>
354
- <link href="http://superfeedr.com/?1298305317" title="16:21:57" rel="alternate" type="text/html"/>
355
- <category term="tests"/>
356
- <author>
357
- <name>Superfeedr</name>
358
- <uri>http://superfeedr.com/</uri>
359
- <email>julien@superfeedr.com</email>
360
- </author>
361
- </entry>
362
- </item>
363
- <item>
364
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
365
- <id>tag:superfeedr.com,2005:String/1298305151</id>
366
- <published>2011-02-21T11:19:11-05:00</published>
367
- <updated>2011-02-21T11:19:11-05:00</updated>
368
- <title>16:19:11</title>
369
- <summary type="text"/>
370
- <content type="text">Monday February 21 16:19:11 UTC 2011 Somebody wanted to know what time it was.</content>
371
- <geo:point>37.773721,-122.414957</geo:point>
372
- <link href="http://superfeedr.com/?1298305151" title="16:19:11" rel="alternate" type="text/html"/>
373
- <category term="tests"/>
374
- <author>
375
- <name>Superfeedr</name>
376
- <uri>http://superfeedr.com/</uri>
377
- <email>julien@superfeedr.com</email>
378
- </author>
379
- </entry>
380
- </item>
381
- <item>
382
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
383
- <id>tag:superfeedr.com,2005:String/1298304372</id>
384
- <published>2011-02-21T11:06:12-05:00</published>
385
- <updated>2011-02-21T11:06:12-05:00</updated>
386
- <title>16:06:12</title>
387
- <summary type="text"/>
388
- <content type="text">Monday February 21 16:06:12 UTC 2011 Somebody wanted to know what time it was.</content>
389
- <geo:point>37.773721,-122.414957</geo:point>
390
- <link href="http://superfeedr.com/?1298304372" title="16:06:12" rel="alternate" type="text/html"/>
391
- <category term="tests"/>
392
- <author>
393
- <name>Superfeedr</name>
394
- <uri>http://superfeedr.com/</uri>
395
- <email>julien@superfeedr.com</email>
396
- </author>
397
- </entry>
398
- </item>
399
- <item>
400
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
401
- <id>tag:superfeedr.com,2005:String/1298304371</id>
402
- <published>2011-02-21T11:06:11-05:00</published>
403
- <updated>2011-02-21T11:06:11-05:00</updated>
404
- <title>16:06:11</title>
405
- <summary type="text"/>
406
- <content type="text">Monday February 21 16:06:11 UTC 2011 Somebody wanted to know what time it was.</content>
407
- <geo:point>37.773721,-122.414957</geo:point>
408
- <link href="http://superfeedr.com/?1298304371" title="16:06:11" rel="alternate" type="text/html"/>
409
- <category term="tests"/>
410
- <author>
411
- <name>Superfeedr</name>
412
- <uri>http://superfeedr.com/</uri>
413
- <email>julien@superfeedr.com</email>
414
- </author>
415
- </entry>
416
- </item>
417
- <item>
418
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
419
- <id>tag:superfeedr.com,2005:String/1298304085</id>
420
- <published>2011-02-21T11:01:25-05:00</published>
421
- <updated>2011-02-21T11:01:25-05:00</updated>
422
- <title>16:01:25</title>
423
- <summary type="text"/>
424
- <content type="text">Monday February 21 16:01:25 UTC 2011 Somebody wanted to know what time it was.</content>
425
- <geo:point>37.773721,-122.414957</geo:point>
426
- <link href="http://superfeedr.com/?1298304085" title="16:01:25" rel="alternate" type="text/html"/>
427
- <category term="tests"/>
428
- <author>
429
- <name>Superfeedr</name>
430
- <uri>http://superfeedr.com/</uri>
431
- <email>julien@superfeedr.com</email>
432
- </author>
433
- </entry>
434
- </item>
435
- <item>
436
- <entry xmlns="http://www.w3.org/2005/Atom" xmlns:geo="http://www.georss.org/georss" xmlns:as="http://activitystrea.ms/spec/1.0/" xmlns:sf="http://superfeedr.com/xmpp-pubsub-ext" xml:lang="en-US">
437
- <id>tag:superfeedr.com,2005:String/1298303653</id>
438
- <published>2011-02-21T10:54:13-05:00</published>
439
- <updated>2011-02-21T10:54:13-05:00</updated>
440
- <title>15:54:13</title>
441
- <summary type="text"/>
442
- <content type="text">Monday February 21 15:54:13 UTC 2011 Somebody wanted to know what time it was.</content>
443
- <geo:point>37.773721,-122.414957</geo:point>
444
- <link href="http://superfeedr.com/?1298303653" title="15:54:13" rel="alternate" type="text/html"/>
445
- <category term="tests"/>
446
- <author>
447
- <name>Superfeedr</name>
448
- <uri>http://superfeedr.com/</uri>
449
- <email>julien@superfeedr.com</email>
450
- </author>
451
- </entry>
452
- </item>
453
- </publish>
454
- </pubsub>
455
- </iq>
456
- EOXML
457
-
458
- @proc = Proc.new { |stanza|
459
- stanza.to_xml.should == @xml.strip
460
- }
461
- @parser = Skates::XmppParser.new(@proc)
462
- end
463
-
464
- it "should parse correctly the namespaces and the attributes" do
465
- @parser.push(@xml)
466
- end
467
- end
468
-
469
- end