hamster 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/History.rdoc +16 -0
  2. data/README.rdoc +10 -10
  3. data/lib/hamster/core_ext/enumerable.rb +1 -1
  4. data/lib/hamster/core_ext/enumerable.rbc +481 -0
  5. data/lib/hamster/core_ext/io.rb +0 -1
  6. data/lib/hamster/core_ext/io.rbc +604 -0
  7. data/lib/hamster/hash.rb +6 -6
  8. data/lib/hamster/hash.rbc +3117 -0
  9. data/lib/hamster/list.rb +50 -14
  10. data/lib/hamster/list.rbc +7274 -0
  11. data/lib/hamster/set.rb +8 -7
  12. data/lib/hamster/set.rbc +3152 -0
  13. data/lib/hamster/stack.rbc +1358 -0
  14. data/lib/hamster/trie.rbc +3416 -0
  15. data/lib/hamster/version.rb +1 -1
  16. data/spec/hamster/core_ext/enumerable_spec.rb +1 -1
  17. data/spec/hamster/core_ext/enumerable_spec.rbc +747 -0
  18. data/spec/hamster/core_ext/io_spec.rbc +409 -0
  19. data/spec/hamster/hash/all_spec.rbc +1214 -0
  20. data/spec/hamster/hash/any_spec.rbc +1495 -0
  21. data/spec/hamster/hash/construction_spec.rbc +742 -0
  22. data/spec/hamster/hash/copying_spec.rbc +519 -0
  23. data/spec/hamster/hash/each_spec.rbc +908 -0
  24. data/spec/hamster/hash/empty_spec.rbc +517 -0
  25. data/spec/hamster/hash/eql_spec.rb +1 -1
  26. data/spec/hamster/hash/eql_spec.rbc +1702 -0
  27. data/spec/hamster/hash/filter_spec.rbc +1433 -0
  28. data/spec/hamster/hash/get_spec.rbc +791 -0
  29. data/spec/hamster/hash/has_key_spec.rbc +719 -0
  30. data/spec/hamster/hash/map_spec.rbc +1454 -0
  31. data/spec/hamster/hash/none_spec.rbc +1399 -0
  32. data/spec/hamster/hash/put_spec.rbc +1334 -0
  33. data/spec/hamster/hash/reduce_spec.rbc +1234 -0
  34. data/spec/hamster/hash/reject_spec.rbc +1445 -0
  35. data/spec/hamster/hash/remove_spec.rbc +1135 -0
  36. data/spec/hamster/hash/size_spec.rbc +596 -0
  37. data/spec/hamster/list/all_spec.rb +12 -4
  38. data/spec/hamster/list/all_spec.rbc +1760 -0
  39. data/spec/hamster/list/any_spec.rb +12 -4
  40. data/spec/hamster/list/any_spec.rbc +1888 -0
  41. data/spec/hamster/list/append_spec.rb +12 -5
  42. data/spec/hamster/list/append_spec.rbc +1555 -0
  43. data/spec/hamster/list/cadr_spec.rb +1 -1
  44. data/spec/hamster/list/cadr_spec.rbc +855 -0
  45. data/spec/hamster/list/cons_spec.rbc +848 -0
  46. data/spec/hamster/list/construction_spec.rbc +1732 -0
  47. data/spec/hamster/list/copying_spec.rbc +555 -0
  48. data/spec/hamster/list/drop_spec.rb +12 -4
  49. data/spec/hamster/list/drop_spec.rbc +1081 -0
  50. data/spec/hamster/list/drop_while_spec.rb +12 -4
  51. data/spec/hamster/list/drop_while_spec.rbc +1286 -0
  52. data/spec/hamster/list/each_spec.rb +13 -5
  53. data/spec/hamster/list/each_spec.rbc +1365 -0
  54. data/spec/hamster/list/empty_spec.rb +1 -1
  55. data/spec/hamster/list/empty_spec.rbc +571 -0
  56. data/spec/hamster/list/eql_spec.rb +15 -5
  57. data/spec/hamster/list/eql_spec.rbc +1819 -0
  58. data/spec/hamster/list/filter_spec.rb +13 -5
  59. data/spec/hamster/list/filter_spec.rbc +1595 -0
  60. data/spec/hamster/list/find_spec.rb +12 -4
  61. data/spec/hamster/list/find_spec.rbc +1456 -0
  62. data/spec/hamster/list/head_spec.rb +1 -1
  63. data/spec/hamster/list/head_spec.rbc +575 -0
  64. data/spec/hamster/list/include_spec.rb +12 -4
  65. data/spec/hamster/list/include_spec.rbc +1173 -0
  66. data/spec/hamster/list/inspect_spec.rb +13 -5
  67. data/spec/hamster/list/inspect_spec.rbc +995 -0
  68. data/spec/hamster/list/map_spec.rb +12 -4
  69. data/spec/hamster/list/map_spec.rbc +1545 -0
  70. data/spec/hamster/list/maximum_spec.rb +83 -0
  71. data/spec/hamster/list/minimum_spec.rb +83 -0
  72. data/spec/hamster/list/none_spec.rb +11 -3
  73. data/spec/hamster/list/none_spec.rbc +1788 -0
  74. data/spec/hamster/list/one_spec.rb +83 -0
  75. data/spec/hamster/list/partition_spec.rb +37 -9
  76. data/spec/hamster/list/partition_spec.rbc +2715 -0
  77. data/spec/hamster/list/reduce_spec.rb +12 -4
  78. data/spec/hamster/list/reduce_spec.rbc +2081 -0
  79. data/spec/hamster/list/reject_spec.rb +12 -4
  80. data/spec/hamster/list/reject_spec.rbc +1590 -0
  81. data/spec/hamster/list/reverse_spec.rb +12 -4
  82. data/spec/hamster/list/reverse_spec.rbc +1061 -0
  83. data/spec/hamster/list/size_spec.rb +13 -5
  84. data/spec/hamster/list/size_spec.rbc +1063 -0
  85. data/spec/hamster/list/tail_spec.rb +1 -1
  86. data/spec/hamster/list/tail_spec.rbc +595 -0
  87. data/spec/hamster/list/take_spec.rb +12 -4
  88. data/spec/hamster/list/take_spec.rbc +1075 -0
  89. data/spec/hamster/list/take_while_spec.rb +12 -4
  90. data/spec/hamster/list/take_while_spec.rbc +1446 -0
  91. data/spec/hamster/list/to_a_spec.rb +31 -19
  92. data/spec/hamster/list/to_a_spec.rbc +961 -0
  93. data/spec/hamster/list/to_ary_spec.rb +11 -3
  94. data/spec/hamster/list/to_ary_spec.rbc +1080 -0
  95. data/spec/hamster/list/to_list_spec.rb +31 -0
  96. data/spec/hamster/set/add_spec.rbc +1039 -0
  97. data/spec/hamster/set/all_spec.rbc +1316 -0
  98. data/spec/hamster/set/any_spec.rbc +1444 -0
  99. data/spec/hamster/set/construction_spec.rbc +422 -0
  100. data/spec/hamster/set/copying_spec.rbc +469 -0
  101. data/spec/hamster/set/each_spec.rbc +820 -0
  102. data/spec/hamster/set/empty_spec.rbc +452 -0
  103. data/spec/hamster/set/eql_spec.rb +1 -1
  104. data/spec/hamster/set/eql_spec.rbc +1309 -0
  105. data/spec/hamster/set/filter_spec.rbc +1272 -0
  106. data/spec/hamster/set/include_spec.rbc +657 -0
  107. data/spec/hamster/set/map_spec.rbc +1285 -0
  108. data/spec/hamster/set/none_spec.rbc +1344 -0
  109. data/spec/hamster/set/reduce_spec.rbc +1177 -0
  110. data/spec/hamster/set/reject_spec.rbc +1273 -0
  111. data/spec/hamster/set/remove_spec.rbc +947 -0
  112. data/spec/hamster/set/size_spec.rbc +531 -0
  113. data/spec/hamster/set/to_a_spec.rb +16 -12
  114. data/spec/hamster/set/to_a_spec.rbc +559 -0
  115. data/spec/hamster/stack/construction_spec.rbc +862 -0
  116. data/spec/hamster/stack/copying_spec.rbc +555 -0
  117. data/spec/hamster/stack/empty_spec.rb +1 -1
  118. data/spec/hamster/stack/empty_spec.rbc +571 -0
  119. data/spec/hamster/stack/eql_spec.rb +1 -1
  120. data/spec/hamster/stack/eql_spec.rbc +1281 -0
  121. data/spec/hamster/stack/inspect_spec.rb +1 -1
  122. data/spec/hamster/stack/inspect_spec.rbc +586 -0
  123. data/spec/hamster/stack/pop_spec.rbc +1099 -0
  124. data/spec/hamster/stack/push_spec.rbc +848 -0
  125. data/spec/hamster/stack/size_spec.rb +1 -1
  126. data/spec/hamster/stack/size_spec.rbc +650 -0
  127. data/spec/hamster/stack/top_spec.rbc +676 -0
  128. data/spec/hamster/trie/remove_spec.rbc +40 -0
  129. data/spec/spec_helper.rbc +163 -0
  130. data/tasks/spec.rbc +201 -0
  131. metadata +90 -2
@@ -18,7 +18,7 @@ describe Hamster::Stack do
18
18
  @stack = Hamster.stack(*values)
19
19
  end
20
20
 
21
- it "returns #{expected}" do
21
+ it "returns #{expected.inspect}" do
22
22
  @stack.inspect.should == expected
23
23
  end
24
24
 
@@ -0,0 +1,586 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 50
13
+ 5
14
+ 42
15
+ 0
16
+ 1
17
+ 42
18
+ 0
19
+ 2
20
+ 61
21
+ 45
22
+ 3
23
+ 46
24
+ 4
25
+ 1
26
+ 7
27
+ 5
28
+ 60
29
+ 77
30
+ 6
31
+ 46
32
+ 7
33
+ 1
34
+ 44
35
+ 46
36
+ 8
37
+ 1
38
+ 14
39
+ 5
40
+ 7
41
+ 9
42
+ 60
43
+ 44
44
+ 46
45
+ 8
46
+ 1
47
+ 14
48
+ 5
49
+ 42
50
+ 10
51
+ 11
52
+ 40
53
+ 12
54
+ 53
55
+ 13
56
+ 44
57
+ 47
58
+ 14
59
+ 1
60
+ 14
61
+ 2
62
+ 11
63
+ I
64
+ 4
65
+ I
66
+ 0
67
+ I
68
+ 0
69
+ I
70
+ 0
71
+ n
72
+ p
73
+ 15
74
+ x
75
+ 4
76
+ File
77
+ n
78
+ n
79
+ x
80
+ 11
81
+ active_path
82
+ x
83
+ 7
84
+ dirname
85
+ s
86
+ 18
87
+ /../../spec_helper
88
+ x
89
+ 1
90
+ +
91
+ x
92
+ 11
93
+ expand_path
94
+ x
95
+ 7
96
+ require
97
+ s
98
+ 13
99
+ hamster/stack
100
+ x
101
+ 7
102
+ Hamster
103
+ n
104
+ x
105
+ 5
106
+ Stack
107
+ M
108
+ 1
109
+ n
110
+ n
111
+ x
112
+ 9
113
+ __block__
114
+ i
115
+ 11
116
+ 5
117
+ 7
118
+ 0
119
+ 60
120
+ 53
121
+ 1
122
+ 44
123
+ 47
124
+ 2
125
+ 1
126
+ 11
127
+ I
128
+ 4
129
+ I
130
+ 0
131
+ I
132
+ -1
133
+ I
134
+ -1
135
+ n
136
+ p
137
+ 3
138
+ s
139
+ 8
140
+ #inspect
141
+ M
142
+ 1
143
+ n
144
+ n
145
+ x
146
+ 9
147
+ __block__
148
+ i
149
+ 41
150
+ 32
151
+ 0
152
+ 7
153
+ 0
154
+ 60
155
+ 32
156
+ 2
157
+ 7
158
+ 1
159
+ 60
160
+ 32
161
+ 1
162
+ 7
163
+ 2
164
+ 60
165
+ 32
166
+ 2
167
+ 7
168
+ 1
169
+ 60
170
+ 7
171
+ 3
172
+ 60
173
+ 7
174
+ 4
175
+ 60
176
+ 32
177
+ 3
178
+ 7
179
+ 5
180
+ 60
181
+ 32
182
+ 2
183
+ 32
184
+ 3
185
+ 53
186
+ 6
187
+ 47
188
+ 7
189
+ 0
190
+ 11
191
+ I
192
+ 6
193
+ I
194
+ 0
195
+ I
196
+ -1
197
+ I
198
+ -1
199
+ n
200
+ p
201
+ 8
202
+ s
203
+ 2
204
+ []
205
+ s
206
+ 1
207
+ A
208
+ s
209
+ 5
210
+ ["A"]
211
+ s
212
+ 1
213
+ B
214
+ s
215
+ 1
216
+ C
217
+ s
218
+ 15
219
+ ["C", "B", "A"]
220
+ M
221
+ 1
222
+ n
223
+ n
224
+ x
225
+ 9
226
+ __block__
227
+ i
228
+ 30
229
+ 55
230
+ 33
231
+ 34
232
+ 17
233
+ 0
234
+ 14
235
+ 34
236
+ 17
237
+ 1
238
+ 14
239
+ 14
240
+ 5
241
+ 18
242
+ 0
243
+ 45
244
+ 0
245
+ 44
246
+ 45
247
+ 1
248
+ 7
249
+ 2
250
+ 60
251
+ 59
252
+ 53
253
+ 3
254
+ 44
255
+ 47
256
+ 4
257
+ 1
258
+ 11
259
+ I
260
+ 6
261
+ I
262
+ 2
263
+ I
264
+ 2
265
+ I
266
+ 2
267
+ n
268
+ p
269
+ 5
270
+ x
271
+ 7
272
+ inspect
273
+ x
274
+ 4
275
+ to_s
276
+ s
277
+ 3
278
+ on
279
+ M
280
+ 1
281
+ n
282
+ n
283
+ x
284
+ 9
285
+ __block__
286
+ i
287
+ 28
288
+ 5
289
+ 53
290
+ 0
291
+ 44
292
+ 47
293
+ 1
294
+ 0
295
+ 14
296
+ 5
297
+ 19
298
+ 1
299
+ 1
300
+ 45
301
+ 2
302
+ 44
303
+ 45
304
+ 3
305
+ 7
306
+ 4
307
+ 60
308
+ 59
309
+ 53
310
+ 5
311
+ 44
312
+ 47
313
+ 6
314
+ 1
315
+ 11
316
+ I
317
+ 4
318
+ I
319
+ 0
320
+ I
321
+ -1
322
+ I
323
+ -1
324
+ n
325
+ p
326
+ 7
327
+ M
328
+ 1
329
+ n
330
+ n
331
+ x
332
+ 9
333
+ __block__
334
+ i
335
+ 14
336
+ 42
337
+ 0
338
+ 1
339
+ 19
340
+ 2
341
+ 0
342
+ 33
343
+ 1
344
+ 48
345
+ 2
346
+ 0
347
+ 35
348
+ 3
349
+ 11
350
+ I
351
+ 4
352
+ I
353
+ 0
354
+ I
355
+ -1
356
+ I
357
+ -1
358
+ n
359
+ p
360
+ 4
361
+ x
362
+ 7
363
+ Hamster
364
+ n
365
+ x
366
+ 5
367
+ stack
368
+ x
369
+ 6
370
+ @stack
371
+ p
372
+ 5
373
+ I
374
+ 0
375
+ I
376
+ 11
377
+ I
378
+ 0
379
+ I
380
+ 12
381
+ I
382
+ e
383
+ x
384
+ 36
385
+ ./spec/hamster/stack/inspect_spec.rb
386
+ p
387
+ 0
388
+ x
389
+ 6
390
+ before
391
+ x
392
+ 7
393
+ inspect
394
+ x
395
+ 4
396
+ to_s
397
+ s
398
+ 8
399
+ returns
400
+ M
401
+ 1
402
+ n
403
+ n
404
+ x
405
+ 9
406
+ __block__
407
+ i
408
+ 12
409
+ 36
410
+ 0
411
+ 45
412
+ 1
413
+ 45
414
+ 2
415
+ 19
416
+ 2
417
+ 1
418
+ 79
419
+ 3
420
+ 11
421
+ I
422
+ 3
423
+ I
424
+ 0
425
+ I
426
+ -1
427
+ I
428
+ -1
429
+ n
430
+ p
431
+ 4
432
+ x
433
+ 6
434
+ @stack
435
+ x
436
+ 7
437
+ inspect
438
+ x
439
+ 6
440
+ should
441
+ x
442
+ 2
443
+ ==
444
+ p
445
+ 5
446
+ I
447
+ 0
448
+ I
449
+ 15
450
+ I
451
+ 0
452
+ I
453
+ 16
454
+ I
455
+ c
456
+ x
457
+ 36
458
+ ./spec/hamster/stack/inspect_spec.rb
459
+ p
460
+ 0
461
+ x
462
+ 2
463
+ it
464
+ p
465
+ 7
466
+ I
467
+ 0
468
+ I
469
+ f
470
+ I
471
+ 0
472
+ I
473
+ 11
474
+ I
475
+ 8
476
+ I
477
+ 15
478
+ I
479
+ 1c
480
+ x
481
+ 36
482
+ ./spec/hamster/stack/inspect_spec.rb
483
+ p
484
+ 0
485
+ x
486
+ 8
487
+ describe
488
+ p
489
+ 7
490
+ I
491
+ 0
492
+ I
493
+ a
494
+ I
495
+ 3
496
+ I
497
+ d
498
+ I
499
+ b
500
+ I
501
+ f
502
+ I
503
+ 1e
504
+ x
505
+ 36
506
+ ./spec/hamster/stack/inspect_spec.rb
507
+ p
508
+ 2
509
+ x
510
+ 6
511
+ values
512
+ x
513
+ 8
514
+ expected
515
+ x
516
+ 4
517
+ each
518
+ p
519
+ 9
520
+ I
521
+ 0
522
+ I
523
+ 7
524
+ I
525
+ 0
526
+ I
527
+ a
528
+ I
529
+ 7
530
+ I
531
+ b
532
+ I
533
+ 11
534
+ I
535
+ c
536
+ I
537
+ 29
538
+ x
539
+ 36
540
+ ./spec/hamster/stack/inspect_spec.rb
541
+ p
542
+ 0
543
+ x
544
+ 8
545
+ describe
546
+ p
547
+ 5
548
+ I
549
+ 0
550
+ I
551
+ 5
552
+ I
553
+ 0
554
+ I
555
+ 7
556
+ I
557
+ b
558
+ x
559
+ 36
560
+ ./spec/hamster/stack/inspect_spec.rb
561
+ p
562
+ 0
563
+ x
564
+ 8
565
+ describe
566
+ p
567
+ 7
568
+ I
569
+ 0
570
+ I
571
+ 1
572
+ I
573
+ 1a
574
+ I
575
+ 3
576
+ I
577
+ 23
578
+ I
579
+ 5
580
+ I
581
+ 32
582
+ x
583
+ 36
584
+ ./spec/hamster/stack/inspect_spec.rb
585
+ p
586
+ 0