mofo 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. data/CHANGELOG +4 -0
  2. data/lib/microformat.rb +11 -1
  3. data/lib/microformat/simple.rb +21 -17
  4. data/lib/mofo/hentry.rb +1 -1
  5. data/lib/mofo/hreview.rb +0 -2
  6. data/lib/mofo/rel_tag.rb +0 -1
  7. data/tests/fixtures/bob.html +69 -0
  8. data/tests/fixtures/chowhound.html +1052 -0
  9. data/tests/fixtures/corkd.html +403 -0
  10. data/tests/fixtures/events.html +39 -0
  11. data/tests/fixtures/fake.html +1 -0
  12. data/tests/fixtures/fauxtank.html +535 -0
  13. data/tests/fixtures/hatom.html +1101 -0
  14. data/tests/fixtures/simple.html +5 -0
  15. data/tests/fixtures/upcoming.html +335 -0
  16. data/tests/format_test.rb +230 -0
  17. data/tests/hatom_test.rb +39 -0
  18. data/tests/test_helper.rb +6 -0
  19. data/tests/xoxo_test.rb +49 -0
  20. data/vendor/testspec-0.2.0/ChangeLog +120 -0
  21. data/vendor/testspec-0.2.0/README +206 -0
  22. data/vendor/testspec-0.2.0/ROADMAP +3 -0
  23. data/vendor/testspec-0.2.0/Rakefile +86 -0
  24. data/vendor/testspec-0.2.0/SPECS +101 -0
  25. data/vendor/testspec-0.2.0/TODO +1 -0
  26. data/vendor/testspec-0.2.0/bin/specrb +103 -0
  27. data/vendor/testspec-0.2.0/examples/stack.rb +38 -0
  28. data/vendor/testspec-0.2.0/examples/stack_spec.rb +119 -0
  29. data/vendor/testspec-0.2.0/lib/test/spec.rb +366 -0
  30. data/vendor/testspec-0.2.0/lib/test/spec/dox.rb +114 -0
  31. data/vendor/testspec-0.2.0/lib/test/spec/rdox.rb +25 -0
  32. data/vendor/testspec-0.2.0/lib/test/spec/should-output.rb +48 -0
  33. data/vendor/testspec-0.2.0/rdoc/classes/Kernel.html +105 -0
  34. data/vendor/testspec-0.2.0/rdoc/classes/Object.html +154 -0
  35. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec.html +132 -0
  36. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/DefinitionError.html +111 -0
  37. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/Should.html +863 -0
  38. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/ShouldNot.html +411 -0
  39. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase.html +220 -0
  40. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase/ClassMethods.html +290 -0
  41. data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase/InstanceMethods.html +195 -0
  42. data/vendor/testspec-0.2.0/rdoc/classes/Test/Unit/UI/RDox/TestRunner.html +222 -0
  43. data/vendor/testspec-0.2.0/rdoc/classes/Test/Unit/UI/SpecDox/TestRunner.html +468 -0
  44. data/vendor/testspec-0.2.0/rdoc/created.rid +1 -0
  45. data/vendor/testspec-0.2.0/rdoc/files/README.html +409 -0
  46. data/vendor/testspec-0.2.0/rdoc/files/ROADMAP.html +112 -0
  47. data/vendor/testspec-0.2.0/rdoc/files/SPECS.html +365 -0
  48. data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/dox_rb.html +108 -0
  49. data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/rdox_rb.html +108 -0
  50. data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/should-output_rb.html +114 -0
  51. data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec_rb.html +123 -0
  52. data/vendor/testspec-0.2.0/rdoc/fr_class_index.html +37 -0
  53. data/vendor/testspec-0.2.0/rdoc/fr_file_index.html +33 -0
  54. data/vendor/testspec-0.2.0/rdoc/fr_method_index.html +95 -0
  55. data/vendor/testspec-0.2.0/rdoc/index.html +24 -0
  56. data/vendor/testspec-0.2.0/rdoc/rdoc-style.css +208 -0
  57. data/vendor/testspec-0.2.0/test/spec_dox.rb +39 -0
  58. data/vendor/testspec-0.2.0/test/spec_flexmock.rb +210 -0
  59. data/vendor/testspec-0.2.0/test/spec_mocha.rb +118 -0
  60. data/vendor/testspec-0.2.0/test/spec_nestedcontexts.rb +26 -0
  61. data/vendor/testspec-0.2.0/test/spec_should-output.rb +26 -0
  62. data/vendor/testspec-0.2.0/test/spec_testspec.rb +311 -0
  63. data/vendor/testspec-0.2.0/test/spec_testspec_order.rb +26 -0
  64. data/vendor/testspec-0.2.0/test/test_testunit.rb +21 -0
  65. metadata +81 -2
@@ -0,0 +1,5 @@
1
+ <div class="vcard">
2
+ <a class="url fn" href="http://ozmm.org/">Chris Wanstrath</a>
3
+ <div class="org">Err the Blog</div>
4
+ <div class="email">chris[at]ozmm[dot]org</div>
5
+ </div>
@@ -0,0 +1,335 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml">
4
+ <head>
5
+ <title>Upcoming.org: Home</title>
6
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
7
+ <meta http-equiv="pragma" content="no-cache" />
8
+ <meta http-equiv="Content-Language" content="en-us" />
9
+ <link rel="shortcut icon" href="/favicon.ico" />
10
+
11
+ <style type="text/css" media="all">
12
+ @import "/css/base.css?v=34";
13
+ </style>
14
+ <link rel="stylesheet" type="text/css" href="/css/print.css?v=34" media="print" />
15
+ <link rel="stylesheet" type="text/css" href="/css/container_2.0.0-b4.css" media="all" />
16
+ <link type="text/css" rel="stylesheet" href="http://us.js2.yimg.com/us.js.yimg.com/lib/common/widgets/2/calendar/css/calendar_2.0.0-b4.css" />
17
+ <script type="text/javascript" src="/js/header.js"></script>
18
+ </head>
19
+ <body>
20
+
21
+ <div id="wrapper">
22
+ <div id="nav">
23
+ <div id="upper">
24
+ <div class="left" style="float: left; margin: 5px 5px 5px 10px;">
25
+ <a href="/">Home</a>
26
+ <img src="/images/pipe_yellow.gif" alt="|" />
27
+ <a href="/metro/">Places</a>
28
+ <img src="/images/pipe_yellow.gif" alt="|" />
29
+ <a href="/friend/">Contacts</a>
30
+ <img src="/images/pipe_yellow.gif" alt="|" />
31
+ <a href="/group/">Groups</a>
32
+ <img src="/images/pipe_yellow.gif" alt="|" />
33
+ <a href="/tag/">Tags</a>
34
+ </div>
35
+
36
+ <div class="right" style="float: right; margin: 5px;">
37
+ <a href="/login/">Sign in</a> or <a href="/register/">join now</a>
38
+
39
+ <a href="http://community.upcoming.org/" style="color: #ffdc6b; margin-left: 10px; font-weight: bold;">Help?</a>
40
+ </div>
41
+ </div>
42
+
43
+ <div id="banner">
44
+ <div id="upcoming-logo"><a href="/"><img src="/images/logo/upcoming_logo2.png" width="262" height="86" alt="Upcoming.org" border="0" /></a></div>
45
+ <div id="yahoo-logo"><a href="http://www.yahoo.com/"><img src="/images/logo/yahoo.png" alt="a Yahoo! company" /></a></div>
46
+ </div>
47
+
48
+ <div id="lower">
49
+ <div class="left" style="float: left; margin: 5px 5px 5px 10px;">
50
+ <a href="/">My Upcoming</a> / <a href="/history/myevents/">My Scrapbook</a>
51
+ <img src="/images/pipe_black.gif" alt="|" />
52
+ <a href="/friend/?friendview=friendevents">My Friends' Events</a>
53
+ <img src="/images/pipe_black.gif" alt="|" />
54
+ <a href="/event/">Explore Events</a>
55
+ <img src="/images/pipe_black.gif" alt="|" />
56
+ <b><a href="/event/add/">Add New Event &raquo;</a></b>
57
+ </div>
58
+
59
+ <div class="right"style="display:none">
60
+ <form name="search" action="/search/" method="get">
61
+ <b>Search:</b>
62
+ <input type="text" name="q" class="text" />
63
+ <input type="hidden" name="scope" value="allmetros" />
64
+ <input type="hidden" name="type" value="Events" />
65
+ <input type="submit" class="submit" value="GO" />
66
+ </form>
67
+ </div>
68
+ </div> <!-- end 'lower' -->
69
+ </div> <!-- end 'nav' -->
70
+
71
+
72
+
73
+ <div id="main">
74
+
75
+ <div id="content">
76
+
77
+ <div id="frontpage-global">
78
+ <div id="featured"><p>Upcoming.org is a <b class="highlight">social events calendar</b> driven by people just like you!</p>
79
+ <p><b>Discover</b> new events, <b>share</b> them with your friends, and <b>add</b> your own.</p>
80
+ </div>
81
+
82
+ <div id="signup"><a href="/register/" class="cta-w"><strong><strong><strong>Join Now!</strong></strong></strong></a>
83
+ <div>or <a href="/login/">Sign in</a><br /> if already have an account!</div>
84
+ <br clear="all" />
85
+ </div>
86
+
87
+ <div id="world-today" class="event-listing">
88
+ <h2>Around the World Today</h2>
89
+ <table class="vcalendar">
90
+ <tr class="vevent">
91
+ <td class="event-main noborder">
92
+ <a href="/event/91073/" class="event-name url summary">Creative Commons Salon SF</a><br />
93
+ <abbr class="location" title=""><a href="/venue/17984">shine</a>, San Francisco, CA</abbr>
94
+ </td>
95
+ <td class="event-attending noborder"><b>78</b><br />people</td>
96
+ </tr>
97
+ <tr class="vevent">
98
+ <td class="event-main ">
99
+ <a href="/event/121819/" class="event-name url summary">Dorkbot SF</a><br />
100
+ <abbr class="location" title=""><a href="/venue/31278">Encounter Studio</a>, san francisco, CA</abbr>
101
+ </td>
102
+ <td class="event-attending "><b>36</b><br />people</td>
103
+ </tr>
104
+ <tr class="vevent">
105
+ <td class="event-main ">
106
+ <a href="/event/95834/" class="event-name url summary">...And You Will Know Us by the Trail ...</a><br />
107
+ <abbr class="location" title=""><a href="/venue/281">Avalon</a>, Boston, MA</abbr>
108
+ </td>
109
+ <td class="event-attending "><b>27</b><br />people</td>
110
+ </tr>
111
+ <tr class="vevent">
112
+ <td class="event-main ">
113
+ <a href="/event/101613/" class="event-name url summary">Broken Social Scene &amp; Do Make Say...</a><br />
114
+ <abbr class="location" title=""><a href="/venue/7516">Lupo&#039;s</a>, Providence, RI</abbr>
115
+ </td>
116
+ <td class="event-attending "><b>16</b><br />people</td>
117
+ </tr>
118
+ <tr class="vevent">
119
+ <td class="event-main ">
120
+ <a href="/event/122979/" class="event-name url summary">Dinner with Simon Murdoch - Former He...</a><br />
121
+ <abbr class="location" title=""><a href="/venue/39499">Adam Street</a>, London, United Kingdom</abbr>
122
+ </td>
123
+ <td class="event-attending "><b>16</b><br />people</td>
124
+ </tr>
125
+ </table>
126
+ </div>
127
+ <div id="news">
128
+ <h2>
129
+ <div class="syndication_widget">
130
+ <div class="widget_button">
131
+ <a href="news/index.xml" class="clicker" alt="Syndicate This"><img src="/images/subscribe_mini.gif" width="32" height="22" border="0" align="absmiddle" /></a>
132
+ </div>
133
+ <div id="site_news__syndication" class="clicker_menu">
134
+ <div class="hd"></div>
135
+ <div class="bd">
136
+ <b>Subscribe Options</b> (<a href="" style="text-align: center" class="clicker_close">Close</a>)
137
+ <hr />
138
+ <ul>
139
+ <li><a href="/news/index.xml" class="xml">XML</a>
140
+ <a href="/news/index.xml">Subscribe to RSS feed</a></li>
141
+ <li><a href="http://add.my.yahoo.com/content?.intl=us&url=http%3A//upcoming.org/news/index.xml"><img src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo3.gif" width="62" height="17" border="0" align="middle" alt="Add to My Yahoo!"></a>
142
+ <a href="http://add.my.yahoo.com/content?.intl=us&url=http%3A//upcoming.org/news/index.xml">Add to My Yahoo!</a></li>
143
+ </ul>
144
+ </div>
145
+ <div class="ft"></div>
146
+ </div>
147
+ </div> Site News
148
+ </h2>
149
+
150
+ <table id="headlines">
151
+ <tr>
152
+ <td class="date" title="1 week ago">10/26</td>
153
+ <td class="headline"><a href="/news/archives/2006/10/26/upcoming/">Upcoming Mobile &raquo;</a></td>
154
+ </tr>
155
+ <tr>
156
+ <td class="date" title="2 weeks ago">10/25</td>
157
+ <td class="headline"><a href="/news/archives/2006/10/25/rsvps_an/">RSVPs and Guestlists for Event Organizers &raquo;</a></td>
158
+ </tr>
159
+ <tr>
160
+ <td class="date" title="5 weeks ago">10/04</td>
161
+ <td class="headline"><a href="/news/archives/2006/10/04/new_scra/">New Scrapbook, Deleting Events, and Hack Day &raquo;</a></td>
162
+ </tr>
163
+ <tr>
164
+ <td class="date" title="5 weeks ago">9/28</td>
165
+ <td class="headline"><a href="/news/archives/2006/09/28/nerdy_ap/">Nerdy API News! &raquo;</a></td>
166
+ </tr>
167
+ </table>
168
+ </div>
169
+ </div>
170
+
171
+ <div id="frontpage-nearby">
172
+
173
+ <div id="topmetros">
174
+ <h1 id="topmetro">
175
+ <a class="highlight" href="http://upcoming.org/metro/us/ca/sf/">San Francisco</a>
176
+ </h1>
177
+ <h2 id="moremetros"><a href="http://upcoming.org/metro/us/ca/sfba/">San Francisco Bay Area</a>, <a href="http://upcoming.org/metro/us/ca/be/">Berkeley</a>, <a href="http://upcoming.org/metro/us/ca/sj/">San Jose</a>, <a href="http://upcoming.org/metro/us/ca/ok/">Oakland</a></h2> <div id="changemetro"><a href="#">&laquo; Change Location</a></div>
178
+ </div>
179
+
180
+ <div id="megasearch" class="newbox">
181
+ <h2>Search for an Event</h2>
182
+ <form name="search" action="/search/" method="get">
183
+ <input type="text" name="q" class="text" />
184
+ <input type="hidden" name="metro" value="nearme" />
185
+ <input type="hidden" name="type" value="Events" />
186
+ <button type="submit">Search!</button>
187
+ </form>
188
+ </div>
189
+
190
+ <div id="nearby-popular" class="event-listing">
191
+ <h2>
192
+ Nearby Popular Events
193
+ <span class="small"><a href="http://upcoming.org/metro/us/ca/sf">see all...</a></span>
194
+ </h2>
195
+ <!-- <div class="sort">Date | Popularity</div> -->
196
+ <table class="vcalendar">
197
+ <tr class="vevent">
198
+ <td class="date noborder">Sat, 11/18</td>
199
+ <td class="event-main noborder">
200
+ <a href="/event/99524/" class="event-name url summary">Laughing Squid: Decade 2</a><br />
201
+ <abbr class="location" title=""><a href="/venue/4660">Mighty</a>, San Francisco, CA</abbr>
202
+ </td>
203
+ <td class="event-attending noborder"><b>241</b><br />people</td>
204
+ </tr>
205
+ <tr class="vevent">
206
+ <td class="date ">Tomorrow</td>
207
+ <td class="event-main ">
208
+ <a href="/event/106074/" class="event-name url summary">Web 2point2</a><br />
209
+ <abbr class="location" title=""><a href="/venue/34128">Microsoft</a>, San Francisco, CA</abbr>
210
+ </td>
211
+ <td class="event-attending "><b>172</b><br />people</td>
212
+ </tr>
213
+ <tr class="vevent">
214
+ <td class="date ">Mon, 1/8</td>
215
+ <td class="event-main ">
216
+ <a href="/event/65582/" class="event-name url summary">Macworld Expo/SF</a><br />
217
+ <abbr class="location" title=""><a href="/venue/936">Moscone Center</a>, San Francisco, CA</abbr>
218
+ </td>
219
+ <td class="event-attending "><b>136</b><br />people</td>
220
+ </tr>
221
+ <tr class="vevent">
222
+ <td class="date ">Sat, 11/18</td>
223
+ <td class="event-main ">
224
+ <a href="/event/83339/" class="event-name url summary">&gt;play 2006: The Berkeley Digital Media Conference</a><br />
225
+ <abbr class="location" title=""><a href="/venue/26841">Haas School of Business, University of California at Berkeley</a>, Berkeley, CA, CA</abbr>
226
+ </td>
227
+ <td class="event-attending "><b>115</b><br />people</td>
228
+ </tr>
229
+ <tr class="vevent">
230
+ <td class="date ">Fri, 11/10</td>
231
+ <td class="event-main ">
232
+ <a href="/event/58757/" class="event-name url summary">Green Festival</a><br />
233
+ <abbr class="location" title=""><a href="/venue/8434">San Francisco Concourse Exhibition Center</a>, San Francisco, CA</abbr>
234
+ </td>
235
+ <td class="event-attending "><b>109</b><br />people</td>
236
+ </tr>
237
+ <tr class="vevent">
238
+ <td class="date ">Sat, 11/11</td>
239
+ <td class="event-main ">
240
+ <a href="/event/98204/" class="event-name url summary">Be the Riottt Music Festival</a><br />
241
+ <abbr class="location" title=""><a href="/venue/2137">Bill Graham Civic Auditorium</a>, San Francisco, CA</abbr>
242
+ </td>
243
+ <td class="event-attending "><b>109</b><br />people</td>
244
+ </tr>
245
+ <tr class="vevent">
246
+ <td class="date ">Sun, 5/20</td>
247
+ <td class="event-main ">
248
+ <a href="/event/79782/" class="event-name url summary">Bay To Breakers 2007</a><br />
249
+ <abbr class="location" title=""><a href="/venue/20252">Howard Street</a>, San Francisco, CA</abbr>
250
+ </td>
251
+ <td class="event-attending "><b>82</b><br />people</td>
252
+ </tr>
253
+ <tr class="vevent">
254
+ <td class="date ">Fri, 11/10</td>
255
+ <td class="event-main ">
256
+ <a href="/event/122345/" class="event-name url summary">Citizen Space Open House</a><br />
257
+ <abbr class="location" title=""><a href="/venue/39294">Citizen Space</a>, San Francisco, CA</abbr>
258
+ </td>
259
+ <td class="event-attending "><b>69</b><br />people</td>
260
+ </tr>
261
+ <tr class="vevent">
262
+ <td class="date ">Thu, 5/24</td>
263
+ <td class="event-main ">
264
+ <a href="/event/110085/" class="event-name url summary">@media 2007 America</a><br />
265
+ <abbr class="location" title=""><a href="/venue/6342">Argent Hotel</a>, San Francisco, CA</abbr>
266
+ </td>
267
+ <td class="event-attending "><b>64</b><br />people</td>
268
+ </tr>
269
+ <tr class="vevent">
270
+ <td class="date ">Sat, 4/28</td>
271
+ <td class="event-main ">
272
+ <a href="/event/76140/" class="event-name url summary">CHI2007</a><br />
273
+ <abbr class="location" title=""><a href="/venue/9960">San Jose Convention Center</a>, San Jose, CA</abbr>
274
+ </td>
275
+ <td class="event-attending "><b>61</b><br />people</td>
276
+ </tr>
277
+ <tr class="vevent">
278
+ <td class="date ">Tue, 6/19</td>
279
+ <td class="event-main ">
280
+ <a href="/event/86284/" class="event-name url summary">Where 2.0 Conference 2007</a><br />
281
+ <abbr class="location" title=""><a href="/venue/9438">Fairmont San Jose</a>, San Jose, CA</abbr>
282
+ </td>
283
+ <td class="event-attending "><b>57</b><br />people</td>
284
+ </tr>
285
+ <tr class="vevent">
286
+ <td class="date ">Fri, 11/10</td>
287
+ <td class="event-main ">
288
+ <a href="/event/73285/" class="event-name url summary">Xiu Xiu</a><br />
289
+ <abbr class="location" title=""><a href="/venue/213">Great American Music Hall</a>, San Francisco, CA</abbr>
290
+ </td>
291
+ <td class="event-attending "><b>48</b><br />people</td>
292
+ </tr>
293
+ </table>
294
+ </div>
295
+ </div>
296
+
297
+ </div> <!-- end 'content' -->
298
+ <div style="clear: both;">&nbsp;</div>
299
+
300
+ </div> <!-- end 'main' -->
301
+ </div> <!-- end 'wrapper' -->
302
+
303
+ <div id="footer">
304
+ <div id="footer_nav">
305
+ <a href="http://community.upcoming.org/">Help</a>
306
+ - <a href="http://community.upcoming.org/docs/Contact_Us">Contact Us</a>
307
+ - <a href="/services/api/">Developers API</a>
308
+ </div>
309
+
310
+ <div id="footer_legal">
311
+ Copyright &copy; 2006 Yahoo! Inc. All rights reserved. -
312
+ <a href="http://docs.yahoo.com/info/copyright/copyright.html">Copyright/IP Policy</a> -
313
+ <a href="http://docs.yahoo.com/info/terms/">Terms of Service</a> -
314
+ <a href="http://privacy.yahoo.com/privacy/us/upcoming/">Privacy Policy</a>
315
+ </div>
316
+ </div> <!-- end 'footer' -->
317
+
318
+ <img alt="" width="1" height="1" src="http://geo.yahoo.com/serv?s=97348511&t=1402093815">
319
+ <!-- YUI Includes -->
320
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/yahoo_2.0.0-b4.js"></script>
321
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dom_2.0.0-b4.js"></script>
322
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/event_2.0.0-b4.js"></script>
323
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/connection_2.0.1-b4.js"></script>
324
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/animation_2.0.0-b4.js"></script>
325
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/widgets/2/container/container_2.0.1-b4.js"></script>
326
+ <script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/widgets/2/calendar/calendar_2.0.0-b4.js"></script>
327
+ <script type="text/javascript" src = "http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dragdrop_2.0.0-b4.js" ></script>
328
+ <script language="JavaScript" type="text/javascript" src="/js/minimega.js?v=34"></script>
329
+ <script language="JavaScript" type="text/javascript" src="/js/form.js?v=34"></script>
330
+
331
+
332
+ </body>
333
+ </html>
334
+
335
+ <!-- web2.up.mud.yahoo.com uncompressed Wed Nov 8 23:42:16 PST 2006 -->
@@ -0,0 +1,230 @@
1
+ require 'tests/test_helper'
2
+ require 'mofo/hcard'
3
+ require 'mofo/hreview'
4
+
5
+ context "A simple hcard definition" do
6
+ specify "should parse a page with an hcard" do
7
+ proc { HCard.find(fixture(:fauxtank)) }.should.not.raise MicroformatNotFound
8
+ end
9
+
10
+ specify "should raise an error if no hcard is found in strict mode" do
11
+ proc { HCard.find(fixture(:fake), :strict => true) }.should.raise MicroformatNotFound
12
+ end
13
+
14
+ specify "should return an empty array if no hcard is found" do
15
+ HCard.find(fixture(:fake)).should.equal []
16
+ end
17
+
18
+ specify "should return nil if no hcard is found with :first" do
19
+ HCard.find(:first => fixture(:fake)).should.equal nil
20
+ end
21
+
22
+ specify "should return nil if no hcard is found with :all" do
23
+ HCard.find(:all => fixture(:fake)).should.equal []
24
+ end
25
+
26
+ specify "should accept a :text option" do
27
+ HCard.find(:text => open(fixture(:fauxtank)).read).should.not.equal []
28
+ HCard.find(:text => open(fixture(:fauxtank)).read).should.not.equal nil
29
+ end
30
+ end
31
+
32
+ context "The parsed fauxtank hCard object" do
33
+ setup do
34
+ $fauxtank ||= HCard.find(:first => fixture(:fauxtank))
35
+ end
36
+
37
+ specify "should be an instance of HCard" do
38
+ $fauxtank.should.be.an.instance_of HCard
39
+ end
40
+
41
+ specify "should have `fauxtank' as the nickname" do
42
+ $fauxtank.nickname.should.equal "fauxtank"
43
+ end
44
+
45
+ specify "should have two email addresses" do
46
+ $fauxtank.email.size.should.equal 2
47
+ $fauxtank.email.first.should.equal "fauxtank [at] gmail.com"
48
+ $fauxtank.email.last.should.equal "chris [at] fauxtank.com"
49
+ end
50
+
51
+ specify "should have `Chris' as the given name" do
52
+ $fauxtank.n.given_name.should.equal "Chris"
53
+ end
54
+
55
+ specify "should have `Murphy' as the family name" do
56
+ $fauxtank.n.family_name.should.equal "Murphy"
57
+ end
58
+
59
+ specify "should have `Chicago' as the locality" do
60
+ $fauxtank.adr.locality.should.equal "Chicago"
61
+ end
62
+
63
+ specify "should have `United States' as the country-name" do
64
+ $fauxtank.adr.country_name.should.equal "United States"
65
+ end
66
+
67
+ specify "should have fauxtank's profile pic as the logo" do
68
+ $fauxtank.logo.should.equal "http://static.flickr.com/25/buddyicons/89622800@N00.jpg?1128967902"
69
+ end
70
+
71
+ specify "should know what properties it found" do
72
+ $fauxtank.properties.sort.should.equal ["fn", "note", "n", "email", "logo", "adr", "nickname", "title", "url"].sort
73
+ end
74
+ end
75
+
76
+ context "The parsed Bob hCard object" do
77
+ setup do
78
+ $bob ||= HCard.find(:first => fixture(:bob))
79
+ end
80
+
81
+ specify "should have three valid emails with type information" do
82
+ $bob.email.value.size.should.equal 3
83
+ $bob.email.type.first.should.equal 'home'
84
+ $bob.email.value.first.should.equal 'bob@gmail.com'
85
+ $bob.email.type[1].should.equal 'work'
86
+ $bob.email.value[1].should.equal 'robert@yahoo.com'
87
+ $bob.email.type.last.should.equal 'home'
88
+ $bob.email.value.last.should.equal 'bobby@gmail.com'
89
+ end
90
+
91
+ specify "should have two valid telephone numbers with type information" do
92
+ $bob.tel.type.size.should.equal 2
93
+ $bob.tel.type.first.should.equal 'home'
94
+ $bob.tel.value.first.should.equal '707-555-9990'
95
+ $bob.tel.type.last.should.equal 'cell'
96
+ $bob.tel.value.last.should.equal '707-555-4756'
97
+ end
98
+
99
+ specify "should have a given, additional, and family name" do
100
+ $bob.n.given_name.should.equal 'Robert'
101
+ $bob.n.additional_name.should.equal 'Albert'
102
+ $bob.n.family_name.should.equal 'Smith'
103
+ end
104
+
105
+ specify "should have a valid url" do
106
+ $bob.url.should.equal "http://nubhub.com/bob"
107
+ end
108
+ end
109
+
110
+ context "The parsed Firesteed hReview object" do
111
+ setup do
112
+ $firesteed ||= HReview.find(:first => fixture(:corkd))
113
+ end
114
+
115
+ specify "should have a valid, coerced dtreviewed field" do
116
+ $firesteed.dtreviewed.should.be.an.instance_of Time
117
+ end
118
+
119
+ specify "should have a rating of 5" do
120
+ $firesteed.rating.should.equal 5
121
+ end
122
+
123
+ specify "should have a description" do
124
+ $firesteed.description.should.equal %[This is probably my favorite every day (well, not every day) wine. It's light, subtly sweet, ripe fruit, slightly spicy oak. It's a bit "slippery", if that makes sense (in a very good way). Highly drinkable.]
125
+ end
126
+
127
+ specify "should have an HCard as the reviewer" do
128
+ $firesteed.reviewer.fn.should.equal "simplebits"
129
+ $firesteed.reviewer.photo.should.equal "/img/icon-user-64.gif"
130
+ $firesteed.reviewer.url.should.equal "/people/simplebits"
131
+ end
132
+
133
+ specify "should have a valid item" do
134
+ $firesteed.item.fn.should.equal "Firesteed 2003 Pinot Noir"
135
+ end
136
+
137
+ specify "should have 7 tags" do
138
+ $firesteed.tags.size.should.equal 7
139
+ $firesteed.tags.first.should.equal "berry"
140
+ $firesteed.tags.last.should.equal "sweet"
141
+ end
142
+ end
143
+
144
+ context "The parsed simple hCard object" do
145
+ setup do
146
+ $simple ||= HCard.find(:first => fixture(:simple))
147
+ end
148
+
149
+ specify "should have an org string" do
150
+ $simple.org.should.be.an.instance_of String
151
+ $simple.org.should.equal "Err the Blog"
152
+ end
153
+
154
+ specify "should have an email string" do
155
+ $simple.email.should.be.an.instance_of String
156
+ $simple.email.should.equal "chris[at]ozmm[dot]org"
157
+ end
158
+
159
+ specify "should have a valid name" do
160
+ $simple.fn.should.equal "Chris Wanstrath"
161
+ end
162
+
163
+ specify "should have a valid url" do
164
+ $simple.url.should.equal "http://ozmm.org/"
165
+ end
166
+ end
167
+
168
+ context "A string should be coercable into" do
169
+ specify "an integer" do
170
+ "2".coerce.should.equal 2
171
+ end
172
+
173
+ specify "a float" do
174
+ "4.0".coerce.should.equal 4.0
175
+ end
176
+
177
+ specify "a datetime" do
178
+ "1985-03-13".coerce.should.equal Time.parse("1985-03-13")
179
+ end
180
+
181
+ specify "a boolean" do
182
+ "true".coerce.should.be true
183
+ "false".coerce.should.be false
184
+ end
185
+ end
186
+
187
+ context "An array of reltag arrays created from the corkd review webpage" do
188
+ setup do
189
+ $tags ||= RelTag.find(:all => fixture(:corkd))
190
+ end
191
+
192
+ specify "should consist of 23 tags" do
193
+ $tags.size.should.equal 23
194
+ end
195
+
196
+ specify "should include the berry and slippery tags" do
197
+ $tags.flatten.should.include 'berry'
198
+ $tags.flatten.should.include 'slippery'
199
+ end
200
+ end
201
+
202
+ context "A string with HTML" do
203
+ specify "should be able to remove the HTML" do
204
+ string = %[<ol> <li><a href="http://diveintomark.org/xml/blink.xml" type="application/rss+xml">dive into mark b-links</a></li> <li><a href="http://www.thauvin.net/blog/xml.jsp?format=rdf" type="application/rss+xml">Eric&#39;s Weblog</a></li> <li><a href="http://intertwingly.net/blog/index.rss2" type="application/rss+xml">Sam Ruby</a></li> <li><a href="http://diveintomark.org/xml/atom.xml" type="application/atom+xml">dive into mark</a></li> <li><a href="http://www.decafbad.com/blog/index.rss" type="application/rss+xml">0xDECAFBAD</a></li> </ol>]
205
+ string.strip_html.strip.should.equal "dive into mark b-links Eric&#39;s Weblog Sam Ruby dive into mark 0xDECAFBAD"
206
+ end
207
+ end
208
+
209
+ context "A web page with three rel tags" do
210
+ setup do
211
+ $page ||= <<-EOF
212
+ <html>
213
+ <body>
214
+ <ul>
215
+ <li><a href="/tags/miracle" rel="tag">miracle</a></li>
216
+ <li><a href="/tags/wonder" rel="tag">wonder</a></li>
217
+ <li><a href="/tags/amusement" rel="tag">amusement</a></li>
218
+ </ul>
219
+ </body>
220
+ </html>
221
+ EOF
222
+ end
223
+
224
+ specify "should produce an array of three RelTag objects" do
225
+ tags = RelTag.find(:all, :text => $page)
226
+ tags.should.be.an.instance_of Array
227
+ tags.size.should.equal 3
228
+ tags.should.equal ["miracle", "wonder", "amusement"]
229
+ end
230
+ end