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 @@
1
+ Wed Oct 18 18:21:29 CEST 2006
@@ -0,0 +1,409 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: README</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>README</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>README
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Wed Oct 18 18:21:27 CEST 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <h1>test/spec, a BDD interface for Test::Unit</h1>
73
+ <p>
74
+ Copyright (C) 2006 Christian Neukirchen &lt;<a
75
+ href="mailto:chneukirchen@gmail.com">chneukirchen@gmail.com</a>&gt;
76
+ </p>
77
+ <h2>What is test/spec?</h2>
78
+ <p>
79
+ test/spec layers an RSpec-inspired interface on top of Test::Unit, so you
80
+ can mix TDD and BDD (Behavior-Driven Development).
81
+ </p>
82
+ <p>
83
+ test/spec is a clean-room implementation that maps most kinds of Test::Unit
84
+ assertions to a `should&#8217;-like syntax.
85
+ </p>
86
+ <p>
87
+ Consider this Test::Unit test case:
88
+ </p>
89
+ <pre>
90
+ class TestFoo &lt; Test::Unit::TestCase
91
+ def test_should_bar
92
+ assert_equal 5, 2 + 3
93
+ end
94
+ end
95
+ </pre>
96
+ <p>
97
+ In test/spec, it looks like this:
98
+ </p>
99
+ <pre>
100
+ require 'test/spec'
101
+
102
+ context &quot;Foo&quot; do
103
+ specify &quot;should bar&quot; do
104
+ (2 + 3).should.equal 5
105
+ end
106
+ end
107
+ </pre>
108
+ <p>
109
+ test/spec does not include a mocking/stubbing-framework; use whichever you
110
+ like to. test/spec has been tested successfully with FlexMock and Mocha.
111
+ </p>
112
+ <p>
113
+ test/spec has no dependencies outside Ruby 1.8.
114
+ </p>
115
+ <h2>Mixing test/spec and test/unit</h2>
116
+ <p>
117
+ test/spec and Test::Unit contexts/test cases can be intermixed freely, run
118
+ in the same test and live in the same files. You can just add them to your
119
+ Rake::TestTask, too. test/spec allows you to leverage your full existing
120
+ Test::Unit infrastructure.
121
+ </p>
122
+ <p>
123
+ test/spec does not change Test::Unit with the exception of monkey-patching
124
+ Test::Unit::TestSuite to order the test cases before running them. (This
125
+ should not do any harm, but if you know a way around it, please tell me.)
126
+ </p>
127
+ <p>
128
+ test/spec adds two global methods, <a
129
+ href="../classes/Object.html#M000001">Object#should</a> and Kernel.context.
130
+ </p>
131
+ <p>
132
+ You can use <tt>assert_*</tt> freely in specify-blocks; <a
133
+ href="../classes/Object.html#M000001">Object#should</a> works in plain
134
+ Test::Unit test cases, too, but they will not be counted.
135
+ </p>
136
+ <h2>Wrapped assertions</h2>
137
+ <table>
138
+ <tr><td valign="top"><tt>assert_equal</tt>:</td><td><tt>should.equal</tt>, <tt>should ==</tt>
139
+
140
+ </td></tr>
141
+ <tr><td valign="top"><tt>assert_not_equal</tt>:</td><td><tt>should.not.equal</tt>, <tt>should.not ==</tt>
142
+
143
+ </td></tr>
144
+ <tr><td valign="top"><tt>assert_same</tt>:</td><td><tt>should.be</tt>
145
+
146
+ </td></tr>
147
+ <tr><td valign="top"><tt>assert_not_same</tt>:</td><td><tt>should.not.be</tt>
148
+
149
+ </td></tr>
150
+ <tr><td valign="top"><tt>assert_nil</tt>:</td><td><tt>should.be.nil</tt>
151
+
152
+ </td></tr>
153
+ <tr><td valign="top"><tt>assert_not_nil</tt>:</td><td><tt>should.not.be.nil</tt>
154
+
155
+ </td></tr>
156
+ <tr><td valign="top"><tt>assert_in_delta</tt>:</td><td><tt>should.be.close</tt>
157
+
158
+ </td></tr>
159
+ <tr><td valign="top"><tt>assert_match</tt>:</td><td><tt>should.match</tt>, <tt>should =~</tt>
160
+
161
+ </td></tr>
162
+ <tr><td valign="top"><tt>assert_no_match</tt>:</td><td><tt>should.not.match</tt>, <tt>should.not =~</tt>
163
+
164
+ </td></tr>
165
+ <tr><td valign="top"><tt>assert_instance_of</tt>:</td><td><tt>should.be.an.instance_of</tt>
166
+
167
+ </td></tr>
168
+ <tr><td valign="top"><tt>assert_kind_of</tt>:</td><td><tt>should.be.a.kind_of</tt>
169
+
170
+ </td></tr>
171
+ <tr><td valign="top"><tt>assert_respond_to</tt>:</td><td><tt>should.respond_to</tt>
172
+
173
+ </td></tr>
174
+ <tr><td valign="top"><tt>assert_raise</tt>:</td><td><tt>should.raise</tt>
175
+
176
+ </td></tr>
177
+ <tr><td valign="top"><tt>assert_nothing_raised</tt>:</td><td><tt>should.not.raise</tt>
178
+
179
+ </td></tr>
180
+ <tr><td valign="top"><tt>assert_throws</tt>:</td><td><tt>should.throw</tt>
181
+
182
+ </td></tr>
183
+ <tr><td valign="top"><tt>assert_nothing_thrown</tt>:</td><td><tt>should.not.throw</tt>
184
+
185
+ </td></tr>
186
+ <tr><td valign="top"><tt>assert_block</tt>:</td><td><tt>should.satisfy</tt>
187
+
188
+ </td></tr>
189
+ </table>
190
+ <p>
191
+ (<tt>a</tt>, <tt>an</tt> and <tt>be</tt> without arguments are optional and
192
+ no-ops.)
193
+ </p>
194
+ <h2>Additional assertions</h2>
195
+ <p>
196
+ These assertions are not included in Test::Unit, but have been added to
197
+ test/spec for convenience:
198
+ </p>
199
+ <ul>
200
+ <li><tt>should.not.satisfy</tt>
201
+
202
+ </li>
203
+ <li><tt>should.include</tt>
204
+
205
+ </li>
206
+ <li><tt>a.should.</tt><em>predicate</em> (works like <tt>assert
207
+ a.</tt><em>predicate</em><tt>?</tt>)
208
+
209
+ </li>
210
+ <li><tt>a.should.be </tt><em>operator</em> (where <em>operator</em> is one of
211
+ <tt>&gt;</tt>, <tt>&gt;=</tt>, <tt>&lt;</tt>, <tt>&lt;=</tt> or
212
+ <tt>===</tt>)
213
+
214
+ </li>
215
+ <li><tt>should.output</tt> (require test/spec/should-output)
216
+
217
+ </li>
218
+ </ul>
219
+ <p>
220
+ If you write an useful general-purpose assertion, I&#8217;d like to hear of
221
+ it and may add it to the test/spec distribution.
222
+ </p>
223
+ <h2>SpecDox and RDox</h2>
224
+ <p>
225
+ test/spec adds two additional test runners to Test::Unit, based on the
226
+ console runner but with a different output format.
227
+ </p>
228
+ <p>
229
+ SpecDox, run with <tt>&#8212;runner=specdox</tt> (or <tt>-rs</tt>) looks
230
+ like RSpec&#8217;s output:
231
+ </p>
232
+ <pre>
233
+ should.output
234
+ - works for print
235
+ - works for puts
236
+ - works with readline
237
+ </pre>
238
+ <p>
239
+ RDox, run with <tt>&#8212;runner=rdox</tt> (or <tt>-rr</tt>) can be
240
+ included for RDoc documentation (e.g. see SPECS):
241
+ </p>
242
+ <pre>
243
+ == should.output
244
+ * works for print
245
+ * works for puts
246
+ * works with readline
247
+ </pre>
248
+ <p>
249
+ SpecDox and RDox work for Test::Unit too:
250
+ </p>
251
+ <pre>
252
+ $ ruby -r test/spec test/testunit/test_testresult.rb -rs
253
+
254
+ Test::Unit::TC_TestResult
255
+ - fault notification
256
+ - passed?
257
+ - result changed notification
258
+
259
+ Finished in 0.106647 seconds.
260
+
261
+ 3 specifications (30 requirements), 0 failures
262
+ </pre>
263
+ <h2>specrb</h2>
264
+ <p>
265
+ Since version 0.2, test/spec features a standalone test runner called
266
+ specrb. specrb is like an extended version of testrb, Test::Unit&#8217;s
267
+ test runner, but has additional options. It can be used for plain
268
+ Test::Unit suites, too.
269
+ </p>
270
+ <pre>
271
+ $ specrb -a -s -n should.output
272
+
273
+ should.output
274
+ - works for print
275
+ - works for puts
276
+ - works with readline
277
+
278
+ Finished in 0.162571 seconds.
279
+
280
+ 3 specifications (6 requirements), 0 failures
281
+ </pre>
282
+ <p>
283
+ Run <tt>specrb &#8212;help</tt> for the usage.
284
+ </p>
285
+ <h2>History</h2>
286
+ <ul>
287
+ <li>September 29th, 2006: First public release 0.1.
288
+
289
+ </li>
290
+ <li>October 18th, 2006: Second public release 0.2.
291
+
292
+ <ul>
293
+ <li>Better, module-based implementation
294
+
295
+ </li>
296
+ <li>Official support for FlexMock and Mocha
297
+
298
+ </li>
299
+ <li>More robust Should#output
300
+
301
+ </li>
302
+ <li>Should#<em>operator</em>
303
+
304
+ </li>
305
+ <li>Nested contexts
306
+
307
+ </li>
308
+ <li>Standalone test/spec runner, specrb
309
+
310
+ </li>
311
+ </ul>
312
+ </li>
313
+ </ul>
314
+ <h2>Contact</h2>
315
+ <p>
316
+ Please mail bugs, suggestions and patches to &lt;<a
317
+ href="mailto:chneukirchen@gmail.com">chneukirchen@gmail.com</a>&gt;.
318
+ </p>
319
+ <p>
320
+ Darcs repository (&quot;darcs send&quot; is welcome for patches): <a
321
+ href="http://chneukirchen.org/repos/testspec">chneukirchen.org/repos/testspec</a>
322
+ </p>
323
+ <h2>Thanks to</h2>
324
+ <ul>
325
+ <li>Eero Saynatkari for writing <tt>should.output</tt>.
326
+
327
+ </li>
328
+ <li>Thomas Fuchs for script.aculo.us BDD testing which convinced me.
329
+
330
+ </li>
331
+ <li>Dave Astels for BDD.
332
+
333
+ </li>
334
+ <li>The RSpec team for API inspiration.
335
+
336
+ </li>
337
+ <li>Nathaniel Talbott for Test::Unit.
338
+
339
+ </li>
340
+ </ul>
341
+ <h2>Copying</h2>
342
+ <p>
343
+ Copyright (C) 2006 Christian Neukirchen &lt;<a
344
+ href="http://purl.org/net/chneukirchen">purl.org/net/chneukirchen</a>&gt;
345
+ </p>
346
+ <p>
347
+ test/spec is licensed under the same terms as Ruby itself.
348
+ </p>
349
+ <p>
350
+ Please mail bugs, feature requests or patches to the mail addresses found
351
+ above or use <a href="irc://freenode.net/#ruby-lang">IRC</a> to contact the
352
+ developer.
353
+ </p>
354
+ <h2>Links</h2>
355
+ <table>
356
+ <tr><td valign="top">Behavior-Driven Development:</td><td>&lt;<a href="http://behaviour-driven.org">behaviour-driven.org</a>/&gt;
357
+
358
+ </td></tr>
359
+ <tr><td valign="top">RSpec:</td><td>&lt;<a href="http://rspec.rubyforge.org">rspec.rubyforge.org</a>/&gt;
360
+
361
+ </td></tr>
362
+ <tr><td valign="top">script.aculo.us testing:</td><td>&lt;<a
363
+ href="http://mir.aculo.us/articles/2006/08/29/bdd-style-javascript-testing">mir.aculo.us/articles/2006/08/29/bdd-style-javascript-testing</a>&gt;
364
+
365
+ </td></tr>
366
+ <tr><td valign="top">FlexMock:</td><td>&lt;<a
367
+ href="http://onestepback.org/software/flexmock">onestepback.org/software/flexmock</a>/&gt;
368
+
369
+ </td></tr>
370
+ <tr><td valign="top">Mocha:</td><td>&lt;<a href="http://mocha.rubyforge.org">mocha.rubyforge.org</a>/&gt;
371
+
372
+ </td></tr>
373
+ <tr><td valign="top">Christian Neukirchen:</td><td>&lt;<a href="http://chneukirchen.org">chneukirchen.org</a>/&gt;
374
+
375
+ </td></tr>
376
+ </table>
377
+
378
+ </div>
379
+
380
+
381
+ </div>
382
+
383
+
384
+ </div>
385
+
386
+
387
+ <!-- if includes -->
388
+
389
+ <div id="section">
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+ <!-- if method_list -->
399
+
400
+
401
+ </div>
402
+
403
+
404
+ <div id="validator-badges">
405
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
406
+ </div>
407
+
408
+ </body>
409
+ </html>
@@ -0,0 +1,112 @@
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
+
6
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
+ <head>
8
+ <title>File: ROADMAP</title>
9
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
+ <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12
+ <script type="text/javascript">
13
+ // <![CDATA[
14
+
15
+ function popupCode( url ) {
16
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
+ }
18
+
19
+ function toggleCode( id ) {
20
+ if ( document.getElementById )
21
+ elem = document.getElementById( id );
22
+ else if ( document.all )
23
+ elem = eval( "document.all." + id );
24
+ else
25
+ return false;
26
+
27
+ elemStyle = elem.style;
28
+
29
+ if ( elemStyle.display != "block" ) {
30
+ elemStyle.display = "block"
31
+ } else {
32
+ elemStyle.display = "none"
33
+ }
34
+
35
+ return true;
36
+ }
37
+
38
+ // Make codeblocks hidden by default
39
+ document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
+
41
+ // ]]>
42
+ </script>
43
+
44
+ </head>
45
+ <body>
46
+
47
+
48
+
49
+ <div id="fileHeader">
50
+ <h1>ROADMAP</h1>
51
+ <table class="header-table">
52
+ <tr class="top-aligned-row">
53
+ <td><strong>Path:</strong></td>
54
+ <td>ROADMAP
55
+ </td>
56
+ </tr>
57
+ <tr class="top-aligned-row">
58
+ <td><strong>Last Update:</strong></td>
59
+ <td>Wed Oct 18 18:21:27 CEST 2006</td>
60
+ </tr>
61
+ </table>
62
+ </div>
63
+ <!-- banner header -->
64
+
65
+ <div id="bodyContent">
66
+
67
+
68
+
69
+ <div id="contextContent">
70
+
71
+ <div id="description">
72
+ <table>
73
+ <tr><td valign="top">Version 0.3 (November 2006):</td><td>deprecate underscore forms.
74
+
75
+ </td></tr>
76
+ <tr><td valign="top">Version 1.0 (Late November 2006):</td><td>first stable release.
77
+
78
+ </td></tr>
79
+ </table>
80
+
81
+ </div>
82
+
83
+
84
+ </div>
85
+
86
+
87
+ </div>
88
+
89
+
90
+ <!-- if includes -->
91
+
92
+ <div id="section">
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+ <!-- if method_list -->
102
+
103
+
104
+ </div>
105
+
106
+
107
+ <div id="validator-badges">
108
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
109
+ </div>
110
+
111
+ </body>
112
+ </html>