public
Description: Life On The Edge With Merb, DataMapper & RSpec
Homepage: http://blog.new-bamboo.co.uk
Clone URL: git://github.com/deimos1986/book_mdar.git
Search Repo:
Split all the book builder stuff into class files so it's sane.
Added support for assets.
added book/output to the git ignore list as this make diffs annoying.
andykent (author)
Fri Feb 22 18:19:11 -0800 2008
commit  6fffb7a938c3bcea5ba458b7f69882586a103aae
tree    d8aea756f82fb5de9bafa5bcb0ed5800d229b13f
parent  c6c19fd9837280213b212b48b599a483379ba967
...
1
2
 
...
1
2
3
0
@@ -1,3 +1,4 @@
0
 .DS_Store
0
 *.log
0
+book/output/*
...
1
 
2
3
4
...
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
...
 
1
2
3
4
...
62
63
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
0
@@ -1,4 +1,4 @@
0
-%W(rubygems rake fileutils BlueCloth hpricot erb).each { |pkg| require pkg }
0
+require 'book_builder/book_builder'
0
 
0
 
0
 
0
@@ -62,165 +62,5 @@
0
 
0
 def default_book
0
   BookBuilder::Book.new('merb_book','./book/', :markdown)
0
-end
0
-
0
-# some helper classes to do all the heavy lifting.
0
-module BookBuilder
0
- class Book
0
- def initialize(name="Book",root_path="./",format="*")
0
- @name = name
0
- @format = format
0
- @root_path = root_path
0
- @files = FileFinder.new("#{@root_path}source/",format)
0
- end
0
-
0
- def html
0
- render(:html)
0
- end
0
-
0
- def html!
0
- save!(self.html,:html)
0
- end
0
-
0
- def plain_text
0
- render(:txt)
0
- end
0
-
0
- def plain_text!
0
- save!(self.plain_text,:txt)
0
- end
0
-
0
- def render(format)
0
- template = ERB.new File.open("#{@root_path}templates/#{@name}.#{format}.erb",'r') { |f| f.read }
0
- template.result(binding)
0
- end
0
-
0
- def save!(txt,format=:txt)
0
- output_file = "#{@root_path}output/#{@name}.#{format}"
0
- FileUtils.touch(output_file)
0
- File.open(output_file,'w') { |file| file << txt }
0
- end
0
-
0
- def parse_body_to(format=:plain_text)
0
- send(:"#{@format}_to_#{format}",body)
0
- end
0
-
0
- def markdown_to_html(text='')
0
- text = text.to_markdown if text.respond_to? :to_markdown
0
- BlueCloth::new(text).to_html
0
- end
0
-
0
- def markdown_to_plain_text(text='')
0
- text.to_markdown if text.respond_to? :to_markdown
0
- text
0
- end
0
-
0
- def body
0
- @files.merged_contents
0
- end
0
-
0
- def toc
0
- ''
0
- Toc.from_html(parse_body_to(:html)).send(:"to_#{@format}")
0
- end
0
-
0
- def parse_toc_to(format=:plain_text)
0
- send(:"#{@format}_to_#{format}",toc)
0
- end
0
-
0
- def prepare!
0
- if File.exists? @root_path
0
- puts "Skipping... '#{@root_path}' already exists"
0
- else
0
- FileUtils.mkdir_p(@root_path)
0
- puts "Created... '#{@root_path}'"
0
- end
0
- FileUtils.cd(@root_path)
0
- %w( output templates source ).each do |dir|
0
- if File.exists? dir
0
- puts "Skipping... '#{@root_path}#{dir}' already exists"
0
- else
0
- FileUtils.mkdir(dir)
0
- puts "Created... '#{@root_path}#{dir}'"
0
- end
0
- end
0
- FileUtils.cd("./templates/")
0
- templates = supported_formats.map { |f| "#{@name}.#{f}.erb" }
0
- templates.each do |template|
0
- if File.exists? template
0
- puts "Skipping... '#{@root_path}templates/#{template}' already exists"
0
- else
0
- FileUtils.touch(template)
0
- puts "Created... '#{@root_path}templates/#{template}'"
0
- end
0
- end
0
- end
0
-
0
- def supported_formats
0
- [:html,:txt]
0
- end
0
- end
0
-
0
- class FileFinder < Array
0
- def initialize(root_path, format)
0
- @format = format.to_s
0
- @root = root_path.to_s
0
- super(Dir["#{@root}**/*.#{@format}"].entries)
0
- end
0
-
0
- def contents
0
- self.map do |path|
0
- File.open(path,'r') { |f| f.read }
0
- end
0
- end
0
-
0
- def merged_contents
0
- self.contents.inject('') { |merged,content| merged << content << "\n" }
0
- end
0
- end
0
-
0
- class Toc
0
- def initialize(html=" ")
0
- @html = html
0
- end
0
-
0
- def self.from_html(html)
0
- new(html)
0
- end
0
-
0
- def doc(refresh=false)
0
- @doc = nil if refresh
0
- @doc ||= Hpricot(@html)
0
- end
0
-
0
- def headers_at_level(level=1)
0
- results = []
0
- (doc/"h#{level}").each { |h| results << h.inner_text }
0
- results
0
- end
0
-
0
- def book_title
0
- headers_at_level(1).first
0
- end
0
-
0
- def each_header_tree_node(&block)
0
- uid = 1
0
- doc.traverse_element('h1', 'h2', 'h3', 'h4', 'h5', 'h6' ) { |h| yield(h,uid); uid+=1}
0
- end
0
-
0
- def to_markdown
0
- output = "#{book_title}\n"
0
- output << "=================================================\n\n"
0
- each_header_tree_node do |h,uid|
0
- output << "#{' '*(h.to_html.slice(2,1).to_i-1)}" # indentation at this heade level
0
- output << "- [#{h.inner_text}](#contents_anchor_#{uid})\n" # list entry with anchor
0
- end
0
- output
0
- end
0
-
0
- def to_plain_text
0
-
0
- end
0
- end
0
 end
...
11
12
13
14
 
15
16
17
18
19
20
 
 
 
 
21
22
23
24
 
 
 
25
26
27
 
 
28
29
30
31
32
 
 
 
 
33
34
 
35
36
37
38
 
 
 
39
40
 
41
42
 
43
44
45
 
 
46
47
 
48
49
 
50
51
52
 
 
53
54
55
 
 
56
57
58
59
 
 
 
60
61
 
62
63
64
 
 
65
66
67
 
 
68
69
70
 
 
71
72
73
74
75
 
76
77
 
 
 
 
 
78
79
80
81
 
82
83
84
85
86
 
 
87
88
89
90
91
92
 
 
 
 
 
 
 
 
 
 
93
94
95
 
 
 
 
 
 
 
 
 
96
97
 
98
99
 
100
101
102
103
 
 
 
104
105
106
107
108
109
 
 
 
 
 
110
111
112
 
 
113
114
 
115
116
117
 
118
119
 
120
121
122
123
 
124
125
126
127
 
128
129
130
131
...
140
141
142
143
 
144
145
146
 
 
147
148
149
...
152
153
154
155
 
156
157
158
...
160
161
162
163
 
164
165
166
...
172
173
174
175
 
176
177
178
179
...
180
181
182
183
 
184
185
186
187
 
188
189
190
191
...
211
212
213
214
 
215
216
217
218
 
219
220
221
...
225
226
227
228
 
229
230
231
...
235
236
237
238
 
239
240
241
242
243
...
245
246
247
248
 
249
250
251
252
253
 
254
255
256
257
258
 
259
260
261
262
263
264
265
266
267
...
265
266
267
268
 
269
270
271
272
 
273
274
275
276
277
278
279
280
281
282
283
284
 
 
 
285
286
287
 
288
 
 
 
 
 
289
290
291
292
 
293
294
295
...
308
309
310
311
 
312
313
314
...
316
317
318
319
 
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
...
325
326
327
328
 
329
330
331
332
333
334
 
335
336
337
338
339
340
341
342
 
343
 
 
344
345
346
 
347
348
349
350
351
352
353
354
355
 
356
357
358
359
360
361
362
 
363
364
365
366
367
368
369
370
 
 
 
371
372
373
 
374
375
376
 
 
 
 
377
378
379
380
381
382
 
383
384
385
 
386
387
388
389
390
391
392
393
394
395
396
397
...
415
416
417
418
 
419
420
421
422
423
 
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
 
443
444
445
 
446
447
 
448
449
450
 
451
452
453
454
455
 
456
457
458
459
460
461
 
462
463
 
464
465
 
466
467
468
...
479
480
481
482
483
484
485
486
487
488
489
...
492
493
494
495
496
497
498
499
500
501
502
503
...
510
511
512
513
 
514
515
516
517
518
519
520
 
521
522
523
524
...
573
574
575
576
 
577
578
 
579
580
581
...
595
596
597
598
 
599
600
601
...
622
623
624
625
 
626
627
628
629
630
631
632
633
634
...
636
637
638
639
 
640
641
642
643
644
 
645
646
647
648
649
650
651
 
652
653
654
655
 
656
657
658
659
 
660
661
662
663
 
664
665
666
667
 
668
669
670
...
680
681
682
683
 
684
685
686
687
...
732
733
734
735
 
736
737
738
739
740
741
742
 
743
744
745
...
750
751
752
753
 
754
755
756
...
758
759
760
761
 
762
763
764
765
766
...
771
772
773
774
 
775
 
 
 
 
 
 
 
 
 
 
 
 
776
777
778
779
780
781
 
782
783
784
785
...
790
791
792
793
 
794
795
796
797
798
 
799
800
801
802
803
804
805
806
807
...
807
808
809
810
 
811
812
813
814
815
 
816
817
818
819
820
 
821
822
823
824
825
826
 
827
828
829
830
 
831
832
833
834
 
835
836
837
838
 
839
840
841
842
843
844
845
...
843
844
845
846
 
847
848
849
850
 
851
852
853
854
 
855
856
857
858
 
859
860
 
861
862
863
...
909
910
911
912
 
913
914
915
916
917
918
919
920
921
922
923
924
925
926
...
938
939
940
941
 
942
 
 
 
 
943
944
945
946
 
947
948
 
949
950
951
952
 
953
954
955
956
 
957
958
959
960
 
961
962
963
964
965
966
 
967
968
969
970
 
971
972
973
974
 
975
976
977
978
 
979
980
981
982
983
984
 
985
986
987
...
1050
1051
1052
1053
 
1054
1055
1056
...
11
12
13
 
14
15
16
 
 
 
 
17
18
19
20
21
 
 
 
22
23
24
25
 
 
26
27
28
 
 
 
 
29
30
31
32
33
 
34
35
 
 
 
36
37
38
39
 
40
41
 
42
43
 
 
44
45
46
 
47
48
 
49
50
 
 
51
52
53
 
 
54
55
56
 
 
 
57
58
59
60
 
61
62
 
 
63
64
65
 
 
66
67
68
 
 
69
70
71
72
 
 
 
73
74
 
75
76
77
78
79
80
 
 
 
81
82
 
 
 
 
83
84
85
 
 
 
 
 
86
87
88
89
90
91
92
93
94
95
96
 
 
97
98
99
100
101
102
103
104
105
106
 
107
108
 
109
110
 
 
 
111
112
113
114
 
 
 
 
 
115
116
117
118
119
120
 
 
121
122
123
 
124
125
126
 
127
128
 
129
130
131
132
 
133
134
135
136
 
137
138
139
140
141
...
150
151
152
 
153
154
 
 
155
156
157
158
159
...
162
163
164
 
165
166
167
168
...
170
171
172
 
173
174
175
176
...
182
183
184
 
185
186
187
188
189
...
190
191
192
 
193
194
195
196
 
197
198
199
200
201
...
221
222
223
 
224
225
226
227
 
228
229
230
231
...
235
236
237
 
238
239
240
241
...
245
246
247
 
248
249
250
251
252
253
...
255
256
257
 
258
259
260
261
262
 
263
264
265
266
267
 
268
269
270
271
272
273
274
275
276
277
...
275
276
277
 
278
279
280
281
 
282
283
284
 
 
285
286
287
288
289
290
 
 
291
292
293
294
295
 
296
297
298
299
300
301
302
303
304
305
 
306
307
308
309
...
322
323
324
 
325
326
327
328
...
330
331
332
 
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
...
339
340
341
 
342
343
344
345
346
347
 
348
349
 
350
 
 
 
 
 
351
352
353
354
355
 
 
356
357
 
358
 
 
 
 
 
 
359
360
361
 
 
 
 
 
362
363
 
364
 
 
 
 
 
365
366
367
368
 
 
369
370
371
372
373
374
375
376
377
 
 
 
 
 
378
379
380
 
381
382
383
384
385
386
387
388
389
390
391
392
393
...
411
412
413
 
414
415
 
 
 
 
416
417
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
419
420
 
421
422
 
423
424
425
 
426
427
428
429
430
 
431
432
433
434
435
436
 
437
438
 
439
440
 
441
442
443
444
...
455
456
457
 
 
 
 
 
458
459
460
...
463
464
465
 
 
 
 
 
466
467
468
469
...
476
477
478
 
479
480
481
482
483
484
485
 
486
487
488
489
490
...
539
540
541
 
542
543
 
544
545
546
547
...
561
562
563
 
564
565
566
567
...
588
589
590
 
591
592
593
594
595
596
597
598
599
600
...
602
603
604
 
605
606
607
608
609
 
610
611
612
613
614
615
616
 
617
618
619
620
 
621
622
623
624
 
625
626
627
628
 
629
630
631
632
 
633
634
635
636
...
646
647
648
 
649
650
651
652
653
...
698
699
700
 
701
702
703
704
705
706
707
 
708
709
710
711
...
716
717
718
 
719
720
721
722
...
724
725
726
 
727
728
729
730
731
732
...
737
738
739
 
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
 
759
760
761
762
763
...
768
769
770
 
771
772
773
774
775
 
776
777
778
779
780
781
782
783
784
785
...
785
786
787
 
788
789
790
791
792
 
793
794
795
796
797
 
798
799
800
801
802
803
 
804
805
806
807
 
808
809
810
811
 
812
813
814
815
 
816
817
818
819
820
821
822
823
...
821
822
823
 
824
825
826
827
 
828
829
830
831
 
832
833
834
835
 
836
837
 
838
839
840
841
...
887
888
889
 
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
...
916
917
918
 
919
920
921
922
923
924
925
926
927
 
928
929
 
930
931
932
933
 
934
935
936
937
 
938
939
940
941
 
942
943
944
945
946
947
 
948
949
950
951
 
952
953
954
955
 
956
957
958
959
 
960
961
962
963
964
965
 
966
967
968
969
...
1032
1033
1034
 
1035
1036
1037
1038
0
@@ -11,120 +11,130 @@
0
 
0
 <body>
0
 
0
-<h1>Life On The Edge With Merb, DataMapper &amp; RSpec</h1>
0
+<h1 id="life_on_the_edge_with_merb_datamapper_rspec">Life On The Edge With Merb, DataMapper &amp; RSpec</h1>
0
 
0
 <ul>
0
-<li><a href="#contents_anchor_1">Life On The Edge With Merb, DataMapper &amp; RSpec</a></li>
0
-<li><a href="#contents_anchor_2">Forward</a></li>
0
-<li><a href="#contents_anchor_3">Preface</a></li>
0
-<li><a href="#contents_anchor_4">What is Merb, DataMapper &amp; RSpec?</a>
0
+<li><a href="#life_on_the_edge_with_merb_datamapper_rspec">Life On The Edge With Merb, DataMapper &amp; RSpec</a></li>
0
+<li><a href="#forward">Forward</a></li>
0
+<li><a href="#preface">Preface</a></li>
0
+<li><a href="#what_is_merb_datamapper_rspec_">What is Merb, DataMapper &amp; RSpec?</a>
0
 <ul>
0
-<li><a href="#contents_anchor_5">Merb</a></li>
0
-<li><a href="#contents_anchor_6">Datamapper</a></li>
0
-<li><a href="#contents_anchor_7">RSpec</a></li>
0
+<li><a href="#merb">Merb</a></li>
0
+<li><a href="#datamapper">Datamapper</a></li>
0
+<li><a href="#rspec">RSpec</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_8">What About Ruby On Rails?</a></li>
0
-<li><a href="#contents_anchor_9">Communities</a>
0
+<li><a href="#what_about_ruby_on_rails_">What About Ruby On Rails?</a></li>
0
+<li><a href="#communities">Communities</a>
0
 <ul>
0
-<li><a href="#contents_anchor_10">Websites</a></li>
0
-<li><a href="#contents_anchor_11">IRC Channels - freenode.net</a></li>
0
-<li><a href="#contents_anchor_12">Mailing Lists</a></li>
0
-<li><a href="#contents_anchor_13">Bug Trackers</a></li>
0
+<li><a href="#websites">Websites</a></li>
0
+<li><a href="#irc_channels_freenode_net">IRC Channels - freenode.net</a></li>
0
+<li><a href="#mailing_lists">Mailing Lists</a></li>
0
+<li><a href="#bug_trackers">Bug Trackers</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_14">Getting Started</a>
0
+<li><a href="#getting_started">Getting Started</a>
0
 <ul>
0
-<li><a href="#contents_anchor_15">Installing Merb</a></li>
0
-<li><a href="#contents_anchor_16">Installing Datamapper</a></li>
0
-<li><a href="#contents_anchor_17">Install RSpec</a></li>
0
+<li><a href="#installing_merb">Installing Merb</a></li>
0
+<li><a href="#installing_datamapper">Installing Datamapper</a></li>
0
+<li><a href="#install_rspec">Install RSpec</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_18">Creating an App</a>
0
+<li><a href="#creating_an_app">Creating an App</a>
0
 <ul>
0
-<li><a href="#contents_anchor_19">Configuring Merb</a></li>
0
+<li><a href="#configuring_merb">Configuring Merb</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_20">The Framework</a></li>
0
-<li><a href="#contents_anchor_21">A little blog</a>
0
+<li><a href="#the_framework">The Framework</a></li>
0
+<li><a href="#a_little_blog">A little blog</a>
0
 <ul>
0
-<li><a href="#contents_anchor_22">Models</a>
0
+<li><a href="#models">Models</a>
0
 <ul>
0
-<li><a href="#contents_anchor_23">Getting started</a>
0
+<li><a href="#getting_started">Getting started</a>
0
 <ul>
0
-<li><a href="#contents_anchor_24">Properties</a></li>
0
-<li><a href="#contents_anchor_25">Associations</a>
0
+<li><a href="#properties">Properties</a></li>
0
+<li><a href="#associations">Associations</a>
0
 <ul>
0
-<li><a href="#contents_anchor_26">Polymorphic associations</a></li>
0
-<li><a href="#contents_anchor_27">Where is my has_many :through?!</a></li>
0
+<li><a href="#polymorphic_associations">Polymorphic associations</a></li>
0
+<li><a href="#where_is_my_has_many_through_">Where is my has_many :through?!</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_28">Validation</a></li>
0
-<li><a href="#contents_anchor_29">Callbacks</a></li>
0
-<li><a href="#contents_anchor_30">Migrations</a></li>
0
+<li><a href="#validation">Validation</a></li>
0
+<li><a href="#callbacks">Callbacks</a></li>
0
+<li><a href="#migrations">Migrations</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_31">CRUD</a>
0
+<li><a href="#crud">CRUD</a>
0
 <ul>
0
-<li><a href="#contents_anchor_32">Creating</a></li>
0
-<li><a href="#contents_anchor_33">Reading (aka finding)</a>
0
+<li><a href="#creating">Creating</a></li>
0
+<li><a href="#reading_aka_finding_">Reading (aka finding)</a>
0
 <ul>
0
-<li><a href="#contents_anchor_34">Count</a></li>
0
-<li><a href="#contents_anchor_35">Each</a></li>
0
+<li><a href="#count">Count</a></li>
0
+<li><a href="#each">Each</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_36">Updating</a></li>
0
-<li><a href="#contents_anchor_37">Destroying</a></li>
0
+<li><a href="#updating">Updating</a></li>
0
+<li><a href="#destroying">Destroying</a></li>
0
 </ul></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_38">Routing</a></li>
0
-<li><a href="#contents_anchor_39">Controllers</a></li>
0
-<li><a href="#contents_anchor_40">Views</a>
0
+<li><a href="#routing">Routing</a>
0
 <ul>
0
-<li><a href="#contents_anchor_41">Partials</a></li>
0
+<li><a href="#strings_regex">Strings/Regex</a></li>
0
+<li><a href="#hashes">Hashes</a></li>
0
+<li><a href="#restful_routes">Restful Routes</a>
0
+<ul>
0
+<li><a href="#nested_routes">Nested Routes</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_42">Mailers</a></li>
0
-<li><a href="#contents_anchor_43">Authentication</a></li>
0
-<li><a href="#contents_anchor_44">Attachments</a></li>
0
+<li><a href="#urls">URLs</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_45">RSpec</a>
0
- - <a href="#contents_anchor_46">What is it?</a>
0
- - <a href="#contents_anchor_47">Why test?</a>
0
- - <a href="#contents_anchor_48">What to test?</a>
0
+<li><a href="#controllers">Controllers</a></li>
0
+<li><a href="#views">Views</a>
0
 <ul>
0
-<li><a href="#contents_anchor_49">mocking</a></li>
0
-<li><a href="#contents_anchor_50">Helpers</a></li>
0
-<li><a href="#contents_anchor_51">Spec'ing Models</a></li>
0
-<li><a href="#contents_anchor_52">Spec'ing Views</a></li>
0
-<li><a href="#contents_anchor_53">Spec'ing Controllers</a>
0
+<li><a href="#partials">Partials</a></li>
0
+</ul></li>
0
+<li><a href="#mailers">Mailers</a></li>
0
+<li><a href="#authentication">Authentication</a></li>
0
+<li><a href="#attachments">Attachments</a></li>
0
+</ul></li>
0
+<li><a href="#rspec">RSpec</a>
0
+ - <a href="#what_is_it_">What is it?</a>
0
+ - <a href="#why_test_">Why test?</a>
0
+ - <a href="#what_to_test_">What to test?</a>
0
 <ul>
0
-<li><a href="#contents_anchor_54">Getting started</a></li>
0
-<li><a href="#contents_anchor_55">Testing multipart forms</a></li>
0
+<li><a href="#">mocking</a></li>
0
+<li><a href="#helpers">Helpers</a></li>
0
+<li><a href="#spec_ing_models">Spec'ing Models</a></li>
0
+<li><a href="#spec_ing_views">Spec'ing Views</a></li>
0
+<li><a href="#spec_ing_controllers">Spec'ing Controllers</a>
0
+<ul>
0
+<li><a href="#getting_started">Getting started</a></li>
0
+<li><a href="#testing_multipart_forms">Testing multipart forms</a></li>
0
+<li><a href="#more_ways_to_dispatch_a_request">More ways to dispatch a request</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_56">Caching</a></li>
0
+<li><a href="#caching">Caching</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_57">Gotchas</a>
0
+<li><a href="#gotchas">Gotchas</a>
0
 <ul>
0
-<li><a href="#contents_anchor_58">Merb</a></li>
0
-<li><a href="#contents_anchor_59">DataMapper</a></li>
0
-<li><a href="#contents_anchor_60">RSpec</a></li>
0
+<li><a href="#merb">Merb</a></li>
0
+<li><a href="#datamapper">DataMapper</a></li>
0
+<li><a href="#rspec">RSpec</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_61">Submitting a patch</a>
0
- - <a href="#contents_anchor_62">Diffs</a>
0
- - <a href="#contents_anchor_63">Docs</a>
0
- - <a href="#contents_anchor_64">Specs</a></li>
0
-<li><a href="#contents_anchor_65">Hacking Merb</a>
0
+<li><a href="#submitting_a_patch">Submitting a patch</a>
0
+ - <a href="#diffs">Diffs</a>
0
+ - <a href="#docs">Docs</a>
0
+ - <a href="#specs">Specs</a></li>
0
+<li><a href="#hacking_merb">Hacking Merb</a>
0
 <ul>
0
-<li><a href="#contents_anchor_66"> </a></li>
0
-<li><a href="#contents_anchor_67">Changing the directory structure</a></li>
0
+<li><a href="#"> </a></li>
0
+<li><a href="#changing_the_directory_structure">Changing the directory structure</a></li>
0
 </ul></li>
0
-<li><a href="#contents_anchor_68">Deploying a Merb App</a></li>
0
+<li><a href="#deploying_a_merb_app">Deploying a Merb App</a></li>