flog 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,944 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+ require 'flog'
3
+ require 'sexp_processor'
4
+
5
+ describe Flog do
6
+ before :each do
7
+ @flog = Flog.new({})
8
+ end
9
+
10
+ describe 'flog_files' do
11
+
12
+ describe 'when given empty input' do
13
+ before :each do
14
+ @files = ['/empty/empty.rb']
15
+ end
16
+
17
+ it 'should not fail when flogging the given input' do
18
+ lambda { @flog.flog_files(fixture_files(@files)) }.should_not raise_error
19
+ end
20
+
21
+ it 'should report an overall flog score of 0' do
22
+ @flog.flog_files(fixture_files(@files))
23
+ @flog.total.should be_close(0.0, 0.0000000001)
24
+ end
25
+ end
26
+
27
+ describe 'when given a simple file' do
28
+ before :each do
29
+ @files = ['/simple/simple.rb']
30
+ @calls = YAML.load(<<-YAML)
31
+ ---
32
+ RailsClassMethods#generate:
33
+ :save: 1.4
34
+ :assignment: 2.80000000000001
35
+ :spawn: 1.4
36
+ RailsClassMethods#exemplar_path:
37
+ :join: 1.4
38
+ ClassMethods#generator_for:
39
+ :is_a?: 2.8
40
+ :arity: 2.0
41
+ :assignment: 16.5
42
+ :respond_to?: 1.7
43
+ :first: 1.6
44
+ :branch: 19.0
45
+ :name: 2.0
46
+ :lit_fixnum: 0.45
47
+ :length: 1.8
48
+ :raise: 8.60000000000001
49
+ :include?: 1.8
50
+ :lambda: 1.8
51
+ :to_sym: 3.1
52
+ :[]: 16.1
53
+ :==: 1.6
54
+ :keys: 3.8
55
+ :record_generator_for: 5.00000000000001
56
+ ObjectDaddy#included:
57
+ :extend: 5.6
58
+ :branch: 2.6
59
+ :sclass: 7.5
60
+ :alias_method: 8.4
61
+ :<: 1.4
62
+ ClassMethods#underscore:
63
+ :gsub: 1.6
64
+ :downcase: 1.4
65
+ ClassMethods#gather_exemplars:
66
+ :load: 1.5
67
+ :underscore: 1.6
68
+ :assignment: 4.40000000000001
69
+ :respond_to?: 1.4
70
+ :superclass: 5.50000000000001
71
+ :branch: 6.00000000000001
72
+ :name: 1.8
73
+ :gather_exemplars: 1.6
74
+ :exemplars_generated: 1.4
75
+ :exists?: 1.4
76
+ :join: 1.4
77
+ :dup: 1.6
78
+ :exemplar_path: 1.6
79
+ :generators: 1.9
80
+ ClassMethods#none:
81
+ :protected: 2.6
82
+ :attr_accessor: 1.3
83
+ :attr_reader: 1.3
84
+ Foo#initialize:
85
+ :super: 1.2
86
+ main#none:
87
+ :assignment: 1.1
88
+ :attr_writer: 1.1
89
+ :branch: 5.60000000000001
90
+ :lit_fixnum: 0.275000000000001
91
+ :puts: 1.1
92
+ :alias: 2.20000000000001
93
+ ClassMethods#record_generator_for:
94
+ :assignment: 1.4
95
+ :branch: 3.20000000000001
96
+ :raise: 1.5
97
+ :==: 1.4
98
+ :[]: 3.50000000000001
99
+ :generators: 3.50000000000001
100
+ RailsClassMethods#validates_presence_of_with_object_daddy:
101
+ :is_a?: 1.4
102
+ :assignment: 5.80000000000001
103
+ :branch: 2.80000000000001
104
+ :last: 1.6
105
+ :dup: 1.4
106
+ :pop: 1.5
107
+ :each: 1.4
108
+ :validates_presence_of_without_object_daddy: 1.4
109
+ ClassMethods#presence_validated_attributes:
110
+ :merge: 1.5
111
+ :presence_validated_attributes: 1.7
112
+ :assignment: 4.30000000000001
113
+ :respond_to?: 1.4
114
+ :superclass: 3.50000000000001
115
+ :branch: 1.4
116
+ ClassMethods#spawn:
117
+ :presence_validated_attributes: 5.4
118
+ :each_pair: 1.4
119
+ :assignment: 35.3
120
+ :generate: 1.7
121
+ :class_name: 2.1
122
+ :call: 1.8
123
+ :reflect_on_all_associations: 1.8
124
+ :branch: 24.0
125
+ :constantize: 1.9
126
+ :name: 3.9
127
+ :gather_exemplars: 1.4
128
+ :select: 1.6
129
+ :-: 1.8
130
+ :send: 5.4
131
+ :to_a: 1.6
132
+ :empty?: 1.5
133
+ :new: 1.4
134
+ :reject!: 1.7
135
+ :next: 1.9
136
+ :delete: 1.9
137
+ :include?: 1.8
138
+ :primary_key_name: 4.2
139
+ :to_s: 5.7
140
+ :each: 3.2
141
+ :keys: 4.0
142
+ :[]: 23.6
143
+ :generators: 1.7
144
+ :scope: 1.6
145
+ RailsClassMethods#generate!:
146
+ :save!: 1.4
147
+ :assignment: 2.80000000000001
148
+ :spawn: 1.4
149
+ YAML
150
+
151
+ @totals = YAML.load(<<-YAML)
152
+ ---
153
+ RailsClassMethods#generate: 3.95979797464467
154
+ ObjectDaddy#included: 23.0471256342304
155
+ ClassMethods#generator_for: 59.7115776043475
156
+ RailsClassMethods#exemplar_path: 1.4
157
+ ClassMethods#underscore: 3.00000000000001
158
+ ClassMethods#none: 5.2
159
+ ClassMethods#gather_exemplars: 23.8882816460289
160
+ ClassMethods#record_generator_for: 10.4980950652964
161
+ main#none: 7.37737249974544
162
+ Foo#initialize: 1.2
163
+ ClassMethods#spawn: 96.0108847995893
164
+ ClassMethods#presence_validated_attributes: 9.27685291464731
165
+ RailsClassMethods#validates_presence_of_with_object_daddy: 10.8245092267502
166
+ RailsClassMethods#generate!: 3.95979797464467
167
+ YAML
168
+ end
169
+
170
+ it 'should not fail when flogging the given input' do
171
+ lambda { @flog.flog_files(fixture_files(@files)) }.should_not raise_error
172
+ end
173
+
174
+ currently 'should report an overall flog score of 259.354295339925' do
175
+ @flog.flog_files(fixture_files(@files))
176
+ @flog.total.should be_close(259.354295339925, 0.0000000001)
177
+ end
178
+
179
+ currently 'should compute the same call data as flog-1.1.0' do
180
+ @flog.flog_files(fixture_files(@files))
181
+ @flog.calls.each_pair do |k,v|
182
+ v.each_pair do |x, y|
183
+ @calls[k][x].should be_close(y, 0.0000000001)
184
+ end
185
+ end
186
+ end
187
+
188
+ currently 'should compute the same totals data as flog-1.1.0' do
189
+ @flog.flog_files(fixture_files(@files))
190
+ @flog.totals.each_pair {|k,v| v.should be_close(@totals[k], 0.0000000001) }
191
+ end
192
+ end
193
+
194
+ # FIX: this is totally unmaintainable
195
+ # describe 'when given a directory of files' do
196
+ # before :each do
197
+ # @files = ['/directory/']
198
+ # @calls = YAML.load(<<-YAML)
199
+ # ---
200
+ # BotSender#validate:
201
+ # :assignment: 1.3
202
+ # BotParserFormat#description:
203
+ # :join: 1.3
204
+ # :branch: 1.2
205
+ # :empty?: 1.2
206
+ # BotParserFormat#initialize:
207
+ # :assignment: 4.8
208
+ # :branch: 1.2
209
+ # :raise: 1.3
210
+ # :nil?: 1.2
211
+ # BotParser#parse:
212
+ # :merge: 1.3
213
+ # :detect: 1.3
214
+ # :assignment: 6.7
215
+ # :branch: 3.9
216
+ # :empty?: 1.3
217
+ # :process: 1.4
218
+ # :formats: 1.5
219
+ # register_format#video:
220
+ # :register_format: 1.2
221
+ # :assignment: 3.6
222
+ # :lit_fixnum: 1.05
223
+ # :[]: 3.6
224
+ # register_format#image:
225
+ # :register_format: 1.2
226
+ # :assignment: 3.6
227
+ # :lit_fixnum: 1.05
228
+ # :[]: 3.6
229
+ # BotFilter#process:
230
+ # :class: 1.6
231
+ # :options: 1.8
232
+ # :kinds: 1.4
233
+ # :assignment: 5.4
234
+ # :branch: 2.5
235
+ # :get: 1.8
236
+ # :process: 1.4
237
+ # :new: 1.6
238
+ # :each: 1.2
239
+ # BotFilter#register:
240
+ # :<<: 1.8
241
+ # BotSender#deliver:
242
+ # :respond_to?: 1.3
243
+ # :assignment: 2.7
244
+ # :send: 4.2
245
+ # :branch: 5.2
246
+ # :raise: 1.4
247
+ # :to_s: 1.5
248
+ # :to_sym: 1.3
249
+ # :[]: 4.5
250
+ # register_format#true_or_false:
251
+ # :register_format: 1.2
252
+ # :assignment: 3.6
253
+ # :lit_fixnum: 0.35
254
+ # :[]: 1.2
255
+ # BotSender#none:
256
+ # :assignment: 1.1
257
+ # :attr_reader: 1.2
258
+ # BotParser#clear_formats:
259
+ # :assignment: 1.9
260
+ # BotSender#register:
261
+ # :each_pair: 1.3
262
+ # :assignment: 6.90000000000001
263
+ # :branch: 1.3
264
+ # register_format#definition:
265
+ # :register_format: 1.2
266
+ # :assignment: 3.6
267
+ # :lit_fixnum: 0.7
268
+ # :[]: 2.4
269
+ # register_format#link:
270
+ # :register_format: 1.2
271
+ # :assignment: 3.6
272
+ # :lit_fixnum: 1.05
273
+ # :[]: 3.6
274
+ # BotParser#none:
275
+ # :assignment: 1.2
276
+ # :sclass: 6.0
277
+ # :attr_reader: 1.8
278
+ # BotParser#register_format:
279
+ # :<<: 1.9
280
+ # :new: 2.1
281
+ # :formats: 2.1
282
+ # :block_pass: 2.1
283
+ # BotSender#initialize:
284
+ # :validate: 1.3
285
+ # :assignment: 2.6
286
+ # :[]: 1.3
287
+ # register_format#quote:
288
+ # :register_format: 1.2
289
+ # :assignment: 3.6
290
+ # :lit_fixnum: 1.05
291
+ # :[]: 3.6
292
+ # BotFilter#register_filter:
293
+ # :register: 1.8
294
+ # :load: 1.8
295
+ # :filter_path: 1.8
296
+ # :assignment: 1.8
297
+ # :exists?: 1.8
298
+ # :branch: 1.8
299
+ # :raise: 1.9
300
+ # BotSender#kinds:
301
+ # :assignment: 1.4
302
+ # :sort_by: 1.3
303
+ # :branch: 1.3
304
+ # :to_s: 1.4
305
+ # :keys: 1.5
306
+ # main#none:
307
+ # :require: 2.2
308
+ # BotFilter#new:
309
+ # :locate_filters: 1.9
310
+ # :assignment: 3.6
311
+ # :send: 5.4
312
+ # :branch: 1.8
313
+ # :allocate: 1.8
314
+ # BotSender#new:
315
+ # :kinds: 1.5
316
+ # :assignment: 2.6
317
+ # :send: 3.9
318
+ # :branch: 1.3
319
+ # :allocate: 1.3
320
+ # :raise: 1.4
321
+ # :include?: 1.3
322
+ # :[]: 4.7
323
+ # BotFilter#locate_filters:
324
+ # :register_filter: 2.0
325
+ # :assignment: 2.0
326
+ # :branch: 5.5
327
+ # :each: 1.9
328
+ # :[]: 4.0
329
+ # BotFilter#get:
330
+ # :gsub: 2.0
331
+ # :upcase: 2.1
332
+ # :assignment: 1.8
333
+ # :const_get: 1.8
334
+ # :branch: 2.0
335
+ # :to_sym: 1.8
336
+ # :to_s: 2.2
337
+ # BotParserFormat#none:
338
+ # :attr_reader: 1.1
339
+ # BotFilter#filter_path:
340
+ # :+: 2.0
341
+ # :dirname: 2.2
342
+ # :expand_path: 1.8
343
+ # BotParserFormat#process:
344
+ # :merge: 1.2
345
+ # :call: 1.4
346
+ # :match: 1.2
347
+ # :format: 1.4
348
+ # :name: 1.4
349
+ # :assignment: 1.2
350
+ # :branch: 1.2
351
+ # :block: 1.6
352
+ # BotParser#formats:
353
+ # :class: 1.5
354
+ # :formats: 1.3
355
+ # BotFilter#initialize:
356
+ # :assignment: 2.4
357
+ # register_format#fact:
358
+ # :register_format: 1.2
359
+ # :assignment: 3.6
360
+ # :lit_fixnum: 0.35
361
+ # :[]: 1.2
362
+ # BotFilter#none:
363
+ # :sclass: 5.5
364
+ # :attr_reader: 1.1
365
+ # YAML
366
+
367
+ # @totals = YAML.load(<<-YAML)
368
+ # ---
369
+ # BotFilter#register: 1.8
370
+ # BotFilter#process: 12.3308556069723
371
+ # register_format#image: 6.86895188511319
372
+ # register_format#video: 6.86895188511319
373
+ # BotParser#parse: 10.3121287811974
374
+ # BotParserFormat#initialize: 5.54346462061408
375
+ # BotParserFormat#description: 2.77308492477241
376
+ # BotSender#validate: 1.3
377
+ # register_format#true_or_false: 4.53017659699929
378
+ # BotSender#deliver: 15.3613150478727
379
+ # BotParser#clear_formats: 1.9
380
+ # BotSender#none: 1.62788205960997
381
+ # BotParser#none: 7.89176786277955
382
+ # register_format#link: 6.86895188511319
383
+ # register_format#definition: 5.60802995712398
384
+ # BotSender#register: 7.14072825417689
385
+ # BotParser#register_format: 8.2
386
+ # BotFilter#register_filter: 9.44933860119321
387
+ # register_format#quote: 6.86895188511319
388
+ # BotSender#initialize: 3.67695526217005
389
+ # BotFilter#new: 9.9503768772846
390
+ # main#none: 2.2
391
+ # BotSender#kinds: 4.61410879802373
392
+ # BotFilter#get: 10.2591422643416
393
+ # BotFilter#locate_filters: 9.83158176490437
394
+ # BotSender#new: 14.3965273590543
395
+ # BotFilter#filter_path: 6.0
396
+ # BotParserFormat#none: 1.1
397
+ # BotFilter#initialize: 2.4
398
+ # BotParser#formats: 2.8
399
+ # BotParserFormat#process: 8.37376856618333
400
+ # BotFilter#none: 6.6
401
+ # register_format#fact: 4.53017659699929
402
+ # YAML
403
+ # end
404
+
405
+ # it 'should not fail when flogging the given input' do
406
+ # lambda { @flog.flog_files(fixture_files(@files)) }.should_not raise_error
407
+ # end
408
+
409
+ # currently 'should report an overall flog score of 209.977217342726' do
410
+ # @flog.flog_files(fixture_files(@files))
411
+ # @flog.total.should be_close(209.977217342726, 0.0000000001)
412
+ # end
413
+
414
+ # currently 'should compute the same call data as flog-1.1.0' do
415
+ # @flog.flog_files(fixture_files(@files))
416
+ # @flog.calls.each_pair do |k,v|
417
+ # v.each_pair do |x, y|
418
+ # @calls[k][x].should be_close(y, 0.0000000001)
419
+ # end
420
+ # end
421
+ # end
422
+
423
+ # currently 'should compute the same totals data as flog-1.1.0' do
424
+ # @flog.flog_files(fixture_files(@files))
425
+ # @flog.totals.each_pair {|k,v| v.should be_close(@totals[k], 0.0000000001) }
426
+ # end
427
+ # end
428
+
429
+ # FIX: this is totally unmaintainable
430
+ # describe 'when given a collection of files' do
431
+ # before :each do
432
+ # @files = ['/collection/']
433
+ # @calls = YAML.load(<<-YAML)
434
+ # ---
435
+ # InstanceMethods#initialize_with_has_many_range_extension:
436
+ # :returning: 1.3
437
+ # :initialize_without_has_many_range_extension: 1.5
438
+ # :macro: 1.90000000000001
439
+ # :add_has_many_range_extension: 1.70000000000001
440
+ # :branch: 2.80000000000001
441
+ # :puts: 6.00000000000002
442
+ # :==: 1.50000000000001
443
+ # :to_s: 1.70000000000001
444
+ # ClassMethods#calculate_with_range_restrictions:
445
+ # :with_current_time_scope: 1.5
446
+ # :calculate_without_range_restrictions: 3.10000000000001
447
+ # :branch: 2.90000000000001
448
+ # :[]: 1.4
449
+ # :acts_as_range_configuration: 1.6
450
+ # InstanceMethods#contained_by?:
451
+ # :to_range: 3.70000000000001
452
+ # :exclude_end?: 3.60000000000001
453
+ # :respond_to?: 1.3
454
+ # :last: 1.8
455
+ # :contained_by?: 1.5
456
+ # :branch: 18.5
457
+ # :>=: 1.9
458
+ # :acts_as_range_begin: 12.5
459
+ # :==: 3.20000000000001
460
+ # :include?: 2.90000000000001
461
+ # :acts_as_range_end: 14.4
462
+ # :<=: 1.9
463
+ # ClassMethods#sequentialized?:
464
+ # :branch: 1.3
465
+ # :sequentialized_on: 1.3
466
+ # InstanceMethods#expired?:
467
+ # :assignment: 1.3
468
+ # :branch: 1.3
469
+ # :now: 1.3
470
+ # :acts_as_range_end: 2.8
471
+ # :<=: 1.3
472
+ # ClassMethods#with_overlapping_scope:
473
+ # :|: 3.00000000000001
474
+ # :with_containing_scope: 4.00000000000001
475
+ # :with_contained_scope: 1.8
476
+ # :flatten: 5.20000000000001
477
+ # :block_pass: 5.80000000000001
478
+ # ClassMethods#with_containing_scope:
479
+ # :acts_as_range_begin_attr: 5.30000000000001
480
+ # :with_scope: 1.4
481
+ # :<<: 11.0
482
+ # :assignment: 4.20000000000001
483
+ # :join: 1.8
484
+ # :table_name: 10.6
485
+ # :branch: 2.80000000000001
486
+ # :acts_as_range_end_attr: 5.30000000000001
487
+ # :block_pass: 1.4
488
+ # :flatten: 1.4
489
+ # :nil?: 2.80000000000001
490
+ # ClassMethods#with_after_scope:
491
+ # :acts_as_range_begin_attr: 3.20000000000001
492
+ # :with_scope: 1.4
493
+ # :table_name: 3.20000000000001
494
+ # :block_pass: 1.4
495
+ # InstanceMethods#overlapping?:
496
+ # :is_a?: 1.4
497
+ # :first: 1.8
498
+ # :respond_to?: 1.3
499
+ # :last: 1.8
500
+ # :assignment: 3.20000000000001
501
+ # :contained_by?: 1.4
502
+ # :containing?: 7.80000000000002
503
+ # :branch: 11.3
504
+ # :acts_as_range_begin: 3.30000000000001
505
+ # :acts_as_range_end: 3.30000000000001
506
+ # ClassMethods#acts_as_date_range_sequentialize_class:
507
+ # :acts_as_date_range_param_sequentialize_class: 1.4
508
+ # :acts_as_date_range_singleton_sequentialize_class: 1.4
509
+ # :branch: 1.3
510
+ # :flatten!: 1.3
511
+ # :==: 1.3
512
+ # ClassMethods#acts_as_date_range_param_sequentialize_class:
513
+ # :validate_on_create: 1.3
514
+ # :add: 1.6
515
+ # :count: 1.7
516
+ # :>: 1.5
517
+ # :acts_as_range_begin_attr: 3.9
518
+ # :class: 3.8
519
+ # :extend: 2.6
520
+ # :errors: 1.8
521
+ # :assignment: 5.80000000000001
522
+ # :before_validation_on_create: 1.3
523
+ # :branch: 6.90000000000001
524
+ # :before_create: 1.3
525
+ # :now: 1.5
526
+ # :acts_as_range_begin: 6.00000000000001
527
+ # :to_sql: 4.2
528
+ # :acts_as_range_end_attr: 4.2
529
+ # :each: 1.5
530
+ # :expire: 1.6
531
+ # :find: 1.7
532
+ # :flatten: 3.8
533
+ # :to_attributes_for: 4.2
534
+ # InstanceMethods#destroy_without_callbacks:
535
+ # :class: 3.8
536
+ # :default_timezone: 1.8
537
+ # :freeze: 1.3
538
+ # :new_record?: 1.3
539
+ # :update_all: 1.6
540
+ # :assignment: 1.6
541
+ # :send: 5.4
542
+ # :branch: 4.3
543
+ # :now: 3.6
544
+ # :acts_as_range_end_attr: 2.0
545
+ # :id: 2.0
546
+ # :utc: 1.7
547
+ # :==: 1.6
548
+ # :[]: 1.4
549
+ # :acts_as_range_configuration: 1.6
550
+ # :quote_value: 1.8
551
+ # ClassMethods#with_contained_scope:
552
+ # :acts_as_range_begin_attr: 7.60000000000002
553
+ # :with_scope: 1.4
554
+ # :<<: 16.8
555
+ # :assignment: 4.20000000000001
556
+ # :join: 1.8
557
+ # :table_name: 15.2
558
+ # :branch: 4.40000000000001
559
+ # :acts_as_range_end_attr: 7.60000000000002
560
+ # :block_pass: 1.4
561
+ # :flatten: 1.4
562
+ # :nil?: 4.40000000000001
563
+ # ClassMethods#count_with_range_restrictions:
564
+ # :count_without_range_restrictions: 3.10000000000001
565
+ # :with_current_time_scope: 1.5
566
+ # :branch: 2.90000000000001
567
+ # :[]: 1.4
568
+ # :acts_as_range_configuration: 1.6
569
+ # InstanceMethods#to_range:
570
+ # :assignment: 2.60000000000001
571
+ # :acts_as_range_begin: 1.3
572
+ # :acts_as_range_end: 1.3
573
+ # ParamExtension#to_attributes_for:
574
+ # :attributes: 1.7
575
+ # :assignment: 1.5
576
+ # :branch: 1.4
577
+ # :[]: 1.5
578
+ # :to_s: 1.7
579
+ # :collect: 1.4
580
+ # ClassMethods#with_current_time_scope:
581
+ # :first: 3.3
582
+ # :respond_to?: 2.7
583
+ # :call: 2.7
584
+ # :with_overlapping_scope: 2.9
585
+ # :end_dated_association_date: 3.1
586
+ # :last: 3.3
587
+ # :assignment: 2.7
588
+ # :with_containing_scope: 2.9
589
+ # :branch: 2.7
590
+ # :block_pass: 5.80000000000001
591
+ # InstanceMethods#included:
592
+ # :extend: 5.20000000000001
593
+ # DateRanged#current:
594
+ # :containing: 1.1
595
+ # :now: 1.3
596
+ # ClassMethods#with_before_scope:
597
+ # :with_scope: 1.4
598
+ # :table_name: 3.20000000000001
599
+ # :acts_as_range_end_attr: 3.20000000000001
600
+ # :block_pass: 1.4
601
+ # ClassMethods#remove_args:
602
+ # :first: 1.5
603
+ # :>: 1.4
604
+ # :last: 2.0
605
+ # :<<: 1.4
606
+ # :extract_options_from_args!: 1.4
607
+ # :assignment: 2.90000000000001
608
+ # :branch: 2.80000000000001
609
+ # :length: 1.6
610
+ # :delete: 1.5
611
+ # :keys: 1.8
612
+ # :each: 1.4
613
+ # ClassMethods#add_args:
614
+ # :merge: 1.6
615
+ # :<<: 1.4
616
+ # :extract_options_from_args!: 1.8
617
+ # InstanceMethods#before?:
618
+ # :respond_to?: 1.3
619
+ # :branch: 3.90000000000001
620
+ # :<: 1.3
621
+ # :before?: 1.4
622
+ # :acts_as_range_begin: 1.6
623
+ # :acts_as_range_end: 2.80000000000001
624
+ # InstanceMethods#containing?:
625
+ # :to_range: 8.50000000000001
626
+ # :is_a?: 1.4
627
+ # :exclude_end?: 6.30000000000001
628
+ # :>: 2.0
629
+ # :first: 4.00000000000001
630
+ # :respond_to?: 1.3
631
+ # :assignment: 3.20000000000001
632
+ # :last: 10.7
633
+ # :contained_by?: 1.4
634
+ # :branch: 28.0
635
+ # :acts_as_range_begin: 8.90000000000002
636
+ # :==: 5.90000000000001
637
+ # :include?: 5.20000000000001
638
+ # :acts_as_range_end: 13.1
639
+ # :<=: 3.70000000000001
640
+ # ClassMethods#acts_as_date_range:
641
+ # :acts_as_range: 1.3
642
+ # :is_a?: 1.3
643
+ # :assignment: 1.3
644
+ # :acts_as_date_range?: 1.3
645
+ # :acts_as_date_range_configure_class: 1.3
646
+ # :branch: 2.6
647
+ # :update: 1.5
648
+ # :raise: 1.4
649
+ # InstanceMethods#limit_date_range:
650
+ # :end_dated_association_date: 1.4
651
+ # :assignment: 6.9
652
+ # :branch: 1.4
653
+ # :yield: 1.4
654
+ # :new: 1.4
655
+ # :acts_as_range_begin: 1.4
656
+ # :acts_as_range_end: 1.4
657
+ # InstanceMethods#lifetime:
658
+ # :>: 1.4
659
+ # :assignment: 1.3
660
+ # :branch: 5.4
661
+ # :now: 1.3
662
+ # :acts_as_range_begin: 4.6
663
+ # :acts_as_range_end: 3.2
664
+ # :distance_of_time_in_words: 1.3
665
+ # :nil?: 2.7
666
+ # ClassMethods#validates_interval:
667
+ # :validation_method: 1.6
668
+ # :add: 1.80000000000001
669
+ # :errors: 2.00000000000001
670
+ # :evaluate_condition: 1.6
671
+ # :assignment: 9.30000000000003
672
+ # :send: 4.20000000000001
673
+ # :branch: 10.9
674
+ # :acts_as_range_begin: 1.70000000000001
675
+ # :acts_as_range_end: 1.70000000000001
676
+ # :each: 1.3
677
+ # :humanize: 2.60000000000001
678
+ # :to_s: 3.00000000000001
679
+ # :[]: 12.3
680
+ # :acts_as_range_configuration: 6.00000000000001
681
+ # :<=: 1.90000000000001
682
+ # :nil?: 3.70000000000001
683
+ # ClassMethods#acts_as_range:
684
+ # :is_a?: 1.3
685
+ # :class_inheritable_reader: 1.3
686
+ # :assignment: 1.3
687
+ # :acts_as_range_configure_class: 1.3
688
+ # :branch: 2.60000000000001
689
+ # :update: 1.5
690
+ # :raise: 1.4
691
+ # :acts_as_range?: 1.3
692
+ # ParamExtension#to_sql:
693
+ # :assignment: 1.7
694
+ # :join: 1.4
695
+ # :branch: 1.6
696
+ # :collect: 1.6
697
+ # ClassMethods#none:
698
+ # :protected: 3.70000000000001
699
+ # :assignment: 1.4
700
+ # :branch: 2.70000000000001
701
+ # :[]: 1.5
702
+ # :to_sym: 1.7
703
+ # :acts_as_range_configuration: 1.7
704
+ # :define_method: 7.00000000000002
705
+ # :each: 1.3
706
+ # DateRange#included:
707
+ # :respond_to?: 1.2
708
+ # :extend: 2.4
709
+ # :assignment: 1.4
710
+ # :branch: 2.6
711
+ # :now: 1.5
712
+ # :new: 1.4
713
+ # :attr: 1.9
714
+ # :sclass: 7.0
715
+ # DateRange#none:
716
+ # :include: 2.2
717
+ # InstanceMethods#add_has_many_range_extension:
718
+ # :options: 1.50000000000001
719
+ # :assignment: 6.00000000000002
720
+ # :push: 1.60000000000001
721
+ # :branch: 2.80000000000001
722
+ # :puts: 5.40000000000002
723
+ # :acts_as_range?: 1.3
724
+ # :include?: 1.50000000000001
725
+ # :[]: 5.20000000000002
726
+ # :klass: 3.00000000000001
727
+ # :flatten: 1.50000000000001
728
+ # Ranged#included:
729
+ # :alias_method_chain: 1.3
730
+ # :branch: 1.2
731
+ # :send: 3.60000000000001
732
+ # :puts: 1.2
733
+ # :instance_eval: 6.00000000000002
734
+ # Range#included:
735
+ # :respond_to?: 1.2
736
+ # :extend: 2.4
737
+ # :assignment: 1.4
738
+ # :branch: 2.6
739
+ # :now: 1.5
740
+ # :new: 1.4
741
+ # :attr: 1.9
742
+ # :sclass: 7.00000000000001
743
+ # InstanceMethods#include?:
744
+ # :class: 3.2
745
+ # :branch: 5.40000000000001
746
+ # :id: 3.2
747
+ # :find: 2.8
748
+ # ClassMethods#acts_as_range?:
749
+ # :included_modules: 1.5
750
+ # :include?: 1.3
751
+ # ClassMethods#acts_as_date_range_configure_class:
752
+ # :acts_as_date_range_sequentialize_class: 1.4
753
+ # :assignment: 1.3
754
+ # :write_inheritable_attribute: 1.3
755
+ # :branch: 1.3
756
+ # :[]: 2.9
757
+ # :include: 2.6
758
+ # InstanceMethods#none:
759
+ # :+: 3.8
760
+ # :class: 9.20000000000001
761
+ # :assignment: 5.60000000000001
762
+ # :private: 1.2
763
+ # :send: 43.2
764
+ # :branch: 8.00000000000001
765
+ # :alias_method: 4.80000000000001
766
+ # :to_s: 4.2
767
+ # :to_sym: 6.80000000000001
768
+ # :define_method: 28.0
769
+ # :each: 2.4
770
+ # Ranged#none:
771
+ # :+: 1.7
772
+ # :assignment: 3.60000000000001
773
+ # :select: 1.2
774
+ # :send: 3.90000000000001
775
+ # :branch: 3.30000000000001
776
+ # :to_sym: 1.5
777
+ # :define_method: 5.50000000000002
778
+ # :each: 1.0
779
+ # ClassMethods#acts_as_range_configure_class:
780
+ # :assignment: 3.20000000000001
781
+ # :write_inheritable_attribute: 1.3
782
+ # :alias_method_chain: 1.90000000000001
783
+ # :branch: 1.8
784
+ # :validates_interval: 1.3
785
+ # :to_sym: 2.1
786
+ # :each: 1.8
787
+ # :sclass: 6.50000000000002
788
+ # :include: 2.60000000000001
789
+ # ClassMethods#ranged_lookup:
790
+ # :first: 1.5
791
+ # :respond_to?: 1.4
792
+ # :last: 1.5
793
+ # :assignment: 7.00000000000002
794
+ # :-: 1.7
795
+ # :branch: 2.80000000000001
796
+ # :to_a: 1.5
797
+ # :yield: 1.4
798
+ # :new: 3.80000000000001
799
+ # :acts_as_range_begin: 1.5
800
+ # :acts_as_range_end: 1.5
801
+ # ClassMethods#find_with_range_restrictions:
802
+ # :find_without_range_restrictions: 9.80000000000002
803
+ # :with_current_time_scope: 1.5
804
+ # :remove_args: 7.50000000000002
805
+ # :with_before_scope: 1.5
806
+ # :extract_options_from_args!: 1.4
807
+ # :assignment: 12.8
808
+ # :with_containing_scope: 1.5
809
+ # :send: 5.40000000000001
810
+ # :with_after_scope: 1.5
811
+ # :branch: 19.7
812
+ # :dup: 1.4
813
+ # :ranged_lookup: 1.7
814
+ # :acts_as_range_configuration: 1.6
815
+ # :==: 1.7
816
+ # :each: 1.4
817
+ # :keys: 9.90000000000002
818
+ # :[]: 12.1
819
+ # :has_key?: 5.70000000000001
820
+ # InstanceMethods#after?:
821
+ # :>: 1.3
822
+ # :respond_to?: 1.3
823
+ # :branch: 3.90000000000001
824
+ # :acts_as_range_begin: 2.80000000000001
825
+ # :after?: 1.4
826
+ # :acts_as_range_end: 1.6
827
+ # ClassMethods#acts_as_date_range_singleton_sequentialize_class:
828
+ # :validate_on_create: 1.3
829
+ # :add: 1.6
830
+ # :count: 1.7
831
+ # :>: 1.5
832
+ # :acts_as_range_begin_attr: 3.7
833
+ # :class: 3.8
834
+ # :errors: 1.8
835
+ # :assignment: 5.8
836
+ # :before_validation_on_create: 1.3
837
+ # :branch: 6.90000000000001
838
+ # :before_create: 1.3
839
+ # :now: 1.5
840
+ # :acts_as_range_begin: 5.6
841
+ # :acts_as_range_end_attr: 3.8
842
+ # :each: 1.5
843
+ # :expire: 1.6
844
+ # :find: 1.7
845
+ # ClassMethods#acts_as_date_range?:
846
+ # :included_modules: 1.5
847
+ # :include?: 1.3
848
+ # InstanceMethods#expire:
849
+ # :second: 1.6
850
+ # :is_a?: 2.7
851
+ # :save!: 1.3
852
+ # :ago: 1.4
853
+ # :assignment: 4.2
854
+ # :-: 1.5
855
+ # :branch: 4.0
856
+ # :now: 1.3
857
+ # :lit_fixnum: 0.875
858
+ # :acts_as_range_end: 1.3
859
+ # ClassMethods#sequentialized_on:
860
+ # :[]: 1.3
861
+ # :acts_as_range_configuration: 1.5
862
+ # YAML
863
+
864
+ # @totals = YAML.load(<<-YAML)
865
+ # ---
866
+ # InstanceMethods#expired?: 5.70438427878067
867
+ # ClassMethods#sequentialized?: 1.83847763108502
868
+ # InstanceMethods#contained_by?: 52.0954892481106
869
+ # ClassMethods#calculate_with_range_restrictions: 8.13449445263812
870
+ # InstanceMethods#initialize_with_has_many_range_extension: 15.8492902049272
871
+ # InstanceMethods#destroy_without_callbacks: 31.238757977871
872
+ # ClassMethods#acts_as_date_range_param_sequentialize_class: 50.3140139523772
873
+ # ClassMethods#acts_as_date_range_sequentialize_class: 5.55427763079954
874
+ # InstanceMethods#overlapping?: 25.0267856505785
875
+ # ClassMethods#with_after_scope: 9.20000000000002
876
+ # ClassMethods#with_containing_scope: 41.3095630574811
877
+ # ClassMethods#with_overlapping_scope: 19.8
878
+ # InstanceMethods#included: 5.20000000000001
879
+ # ClassMethods#with_current_time_scope: 26.9716517847907
880
+ # ParamExtension#to_attributes_for: 6.62570750939099
881
+ # InstanceMethods#to_range: 3.67695526217005
882
+ # ClassMethods#count_with_range_restrictions: 8.13449445263812
883
+ # ClassMethods#with_contained_scope: 57.9202900545225
884
+ # InstanceMethods#lifetime: 15.5273951453552
885
+ # InstanceMethods#limit_date_range: 9.92824254337091
886
+ # ClassMethods#acts_as_date_range: 8.60581198958007
887
+ # InstanceMethods#containing?: 77.6916983982203
888
+ # InstanceMethods#before?: 9.2612094242599
889
+ # ClassMethods#add_args: 4.80000000000001
890
+ # ClassMethods#remove_args: 14.5688022843335
891
+ # ClassMethods#with_before_scope: 9.20000000000002
892
+ # DateRanged#current: 2.40000000000001
893
+ # DateRange#none: 2.2
894
+ # DateRange#included: 15.6805612144464
895
+ # ClassMethods#none: 17.171487996094
896
+ # ParamExtension#to_sql: 3.80131556174965
897
+ # ClassMethods#acts_as_range: 8.6058119895801
898
+ # ClassMethods#validates_interval: 47.6073523733468
899
+ # Range#included: 15.6805612144464
900
+ # Ranged#included: 12.1593585357124
901
+ # InstanceMethods#add_has_many_range_extension: 22.0190826330255
902
+ # InstanceMethods#include?: 10.6677082824757
903
+ # InstanceMethods#none: 104.05921391208
904
+ # ClassMethods#acts_as_date_range_configure_class: 8.40357066966181
905
+ # ClassMethods#acts_as_range?: 2.80000000000001
906
+ # InstanceMethods#expire: 13.3056613890479
907
+ # ClassMethods#acts_as_date_range?: 2.8
908
+ # ClassMethods#acts_as_date_range_singleton_sequentialize_class: 34.8846671189507
909
+ # InstanceMethods#after?: 9.2612094242599
910
+ # ClassMethods#find_with_range_restrictions: 69.6799110217573
911
+ # ClassMethods#ranged_lookup: 17.5065701952153
912
+ # ClassMethods#acts_as_range_configure_class: 17.8809954980141
913
+ # Ranged#none: 15.5849286170968
914
+ # ClassMethods#sequentialized_on: 2.8
915
+ # YAML
916
+ # end
917
+
918
+ # it 'should not fail when flogging the given input' do
919
+ # lambda { @flog.flog_files(fixture_files(@files)) }.should_not raise_error
920
+ # end
921
+
922
+ # currently 'should report an overall flog score of 981.137760580242' do
923
+ # @flog.flog_files(fixture_files(@files))
924
+ # @flog.total.should be_close(981.137760580242, 0.0000000001)
925
+ # end
926
+
927
+ # currently 'should compute the same call data as flog-1.1.0' do
928
+ # @flog.flog_files(fixture_files(@files))
929
+ # @flog.calls.each_pair do |k,v|
930
+ # v.each_pair do |x, y|
931
+ # @calls[k][x].should be_close(y, 0.0000000001)
932
+ # end
933
+ # end
934
+ # end
935
+
936
+ # currently 'should compute the same totals data as flog-1.1.0' do
937
+ # @flog.flog_files(fixture_files(@files))
938
+ # @flog.totals.each_pair do |k,v|
939
+ # v.should be_close(@totals[k], 0.0000000001)
940
+ # end
941
+ # end
942
+ # end
943
+ end
944
+ end