configy 0.0.4 → 1.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.
data/test/test_helper.rb CHANGED
@@ -1,9 +1,42 @@
1
1
  require 'rubygems'
2
- require 'test/unit'
3
-
4
- $LOAD_PATH.unshift(File.dirname(__FILE__))
5
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ require 'bundler/setup'
3
+ require 'minitest/autorun'
4
+ require 'minitest/mock'
5
+ require 'fileutils'
6
+ require 'pathname'
6
7
  require 'configy'
7
8
 
8
- class Test::Unit::TestCase
9
+ module Configy::TestHelpers
10
+ def assert_equal_with_hash(config, hash)
11
+ hash.each do |key, value|
12
+ assert_equal config.send(key), value
13
+ end
14
+ end
15
+
16
+ def with_config_file(conf, file='config')
17
+ path = file_path(file)
18
+ File.open(path, 'w') { |f| f.write conf.is_a?(String) ? conf : conf.to_yaml }
19
+ yield(path, conf)
20
+ ensure
21
+ FileUtils.rm path
22
+ end
23
+
24
+ def file_path(file)
25
+ File.join(scratch_dir, "#{file}.yml")
26
+ end
27
+
28
+ def scratch_dir
29
+ @scratch_dir ||= File.expand_path("../scratch", __FILE__)
30
+ end
31
+
32
+ def with_const(const, value)
33
+ Object.const_set const, value
34
+ yield
35
+ Object.send :remove_const, const
36
+ end
37
+
38
+ end
39
+
40
+ class MiniTest::Unit::TestCase
41
+ include Configy::TestHelpers
9
42
  end
@@ -0,0 +1,1061 @@
1
+ !RBIX
2
+ 0
3
+ x
4
+ M
5
+ 1
6
+ n
7
+ n
8
+ x
9
+ 10
10
+ __script__
11
+ i
12
+ 124
13
+ 5
14
+ 7
15
+ 0
16
+ 64
17
+ 47
18
+ 49
19
+ 1
20
+ 1
21
+ 15
22
+ 5
23
+ 7
24
+ 2
25
+ 64
26
+ 47
27
+ 49
28
+ 1
29
+ 1
30
+ 15
31
+ 5
32
+ 7
33
+ 3
34
+ 64
35
+ 47
36
+ 49
37
+ 1
38
+ 1
39
+ 15
40
+ 5
41
+ 7
42
+ 4
43
+ 64
44
+ 47
45
+ 49
46
+ 1
47
+ 1
48
+ 15
49
+ 5
50
+ 7
51
+ 5
52
+ 64
53
+ 47
54
+ 49
55
+ 1
56
+ 1
57
+ 15
58
+ 5
59
+ 7
60
+ 6
61
+ 64
62
+ 47
63
+ 49
64
+ 1
65
+ 1
66
+ 15
67
+ 5
68
+ 7
69
+ 7
70
+ 64
71
+ 47
72
+ 49
73
+ 1
74
+ 1
75
+ 15
76
+ 99
77
+ 7
78
+ 8
79
+ 45
80
+ 9
81
+ 10
82
+ 49
83
+ 11
84
+ 2
85
+ 13
86
+ 99
87
+ 12
88
+ 7
89
+ 12
90
+ 12
91
+ 7
92
+ 13
93
+ 12
94
+ 65
95
+ 12
96
+ 49
97
+ 14
98
+ 4
99
+ 15
100
+ 49
101
+ 12
102
+ 0
103
+ 15
104
+ 99
105
+ 7
106
+ 15
107
+ 1
108
+ 45
109
+ 16
110
+ 17
111
+ 43
112
+ 18
113
+ 49
114
+ 19
115
+ 3
116
+ 13
117
+ 99
118
+ 12
119
+ 7
120
+ 20
121
+ 12
122
+ 7
123
+ 21
124
+ 12
125
+ 65
126
+ 12
127
+ 49
128
+ 14
129
+ 4
130
+ 15
131
+ 49
132
+ 20
133
+ 0
134
+ 15
135
+ 2
136
+ 11
137
+ I
138
+ 6
139
+ I
140
+ 0
141
+ I
142
+ 0
143
+ I
144
+ 0
145
+ n
146
+ p
147
+ 22
148
+ s
149
+ 8
150
+ rubygems
151
+ x
152
+ 7
153
+ require
154
+ s
155
+ 13
156
+ bundler/setup
157
+ s
158
+ 16
159
+ minitest/autorun
160
+ s
161
+ 13
162
+ minitest/mock
163
+ s
164
+ 9
165
+ fileutils
166
+ s
167
+ 8
168
+ pathname
169
+ s
170
+ 7
171
+ configy
172
+ x
173
+ 11
174
+ TestHelpers
175
+ x
176
+ 7
177
+ Configy
178
+ n
179
+ x
180
+ 17
181
+ open_module_under
182
+ x
183
+ 15
184
+ __module_init__
185
+ M
186
+ 1
187
+ n
188
+ n
189
+ x
190
+ 11
191
+ TestHelpers
192
+ i
193
+ 72
194
+ 5
195
+ 66
196
+ 99
197
+ 7
198
+ 0
199
+ 7
200
+ 1
201
+ 65
202
+ 67
203
+ 49
204
+ 2
205
+ 0
206
+ 49
207
+ 3
208
+ 4
209
+ 15
210
+ 99
211
+ 7
212
+ 4
213
+ 7
214
+ 5
215
+ 65
216
+ 67
217
+ 49
218
+ 2
219
+ 0
220
+ 49
221
+ 3
222
+ 4
223
+ 15
224
+ 99
225
+ 7
226
+ 6
227
+ 7
228
+ 7
229
+ 65
230
+ 67
231
+ 49
232
+ 2
233
+ 0
234
+ 49
235
+ 3
236
+ 4
237
+ 15
238
+ 99
239
+ 7
240
+ 8
241
+ 7
242
+ 9
243
+ 65
244
+ 67
245
+ 49
246
+ 2
247
+ 0
248
+ 49
249
+ 3
250
+ 4
251
+ 15
252
+ 99
253
+ 7
254
+ 10
255
+ 7
256
+ 11
257
+ 65
258
+ 67
259
+ 49
260
+ 2
261
+ 0
262
+ 49
263
+ 3
264
+ 4
265
+ 11
266
+ I
267
+ 5
268
+ I
269
+ 0
270
+ I
271
+ 0
272
+ I
273
+ 0
274
+ n
275
+ p
276
+ 12
277
+ x
278
+ 22
279
+ assert_equal_with_hash
280
+ M
281
+ 1
282
+ n
283
+ n
284
+ x
285
+ 22
286
+ assert_equal_with_hash
287
+ i
288
+ 8
289
+ 20
290
+ 1
291
+ 56
292
+ 0
293
+ 50
294
+ 1
295
+ 0
296
+ 11
297
+ I
298
+ 4
299
+ I
300
+ 2
301
+ I
302
+ 2
303
+ I
304
+ 2
305
+ n
306
+ p
307
+ 2
308
+ M
309
+ 1
310
+ p
311
+ 2
312
+ x
313
+ 9
314
+ for_block
315
+ t
316
+ n
317
+ x
318
+ 22
319
+ assert_equal_with_hash
320
+ i
321
+ 26
322
+ 58
323
+ 37
324
+ 19
325
+ 0
326
+ 15
327
+ 37
328
+ 19
329
+ 1
330
+ 15
331
+ 15
332
+ 5
333
+ 21
334
+ 1
335
+ 0
336
+ 20
337
+ 0
338
+ 49
339
+ 0
340
+ 1
341
+ 20
342
+ 1
343
+ 47
344
+ 49
345
+ 1
346
+ 2
347
+ 11
348
+ I
349
+ 6
350
+ I
351
+ 2
352
+ I
353
+ 2
354
+ I
355
+ 2
356
+ n
357
+ p
358
+ 2
359
+ x
360
+ 4
361
+ send
362
+ x
363
+ 12
364
+ assert_equal
365
+ p
366
+ 5
367
+ I
368
+ 0
369
+ I
370
+ b
371
+ I
372
+ a
373
+ I
374
+ c
375
+ I
376
+ 1a
377
+ x
378
+ 60
379
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
380
+ p
381
+ 2
382
+ x
383
+ 3
384
+ key
385
+ x
386
+ 5
387
+ value
388
+ x
389
+ 4
390
+ each
391
+ p
392
+ 5
393
+ I
394
+ 0
395
+ I
396
+ a
397
+ I
398
+ 0
399
+ I
400
+ b
401
+ I
402
+ 8
403
+ x
404
+ 60
405
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
406
+ p
407
+ 2
408
+ x
409
+ 6
410
+ config
411
+ x
412
+ 4
413
+ hash
414
+ x
415
+ 17
416
+ method_visibility
417
+ x
418
+ 15
419
+ add_defn_method
420
+ x
421
+ 16
422
+ with_config_file
423
+ M
424
+ 1
425
+ n
426
+ n
427
+ x
428
+ 16
429
+ with_config_file
430
+ i
431
+ 72
432
+ 23
433
+ 1
434
+ 10
435
+ 10
436
+ 7
437
+ 0
438
+ 64
439
+ 19
440
+ 1
441
+ 15
442
+ 29
443
+ 50
444
+ 1
445
+ 26
446
+ 93
447
+ 0
448
+ 15
449
+ 5
450
+ 20
451
+ 1
452
+ 47
453
+ 49
454
+ 1
455
+ 1
456
+ 19
457
+ 2
458
+ 15
459
+ 45
460
+ 2
461
+ 3
462
+ 20
463
+ 2
464
+ 7
465
+ 4
466
+ 64
467
+ 56
468
+ 5
469
+ 50
470
+ 6
471
+ 2
472
+ 15
473
+ 20
474
+ 2
475
+ 20
476
+ 0
477
+ 60
478
+ 2
479
+ 30
480
+ 8
481
+ 62
482
+ 26
483
+ 45
484
+ 7
485
+ 8
486
+ 20
487
+ 2
488
+ 49
489
+ 9
490
+ 1
491
+ 15
492
+ 27
493
+ 34
494
+ 45
495
+ 7
496
+ 10
497
+ 20
498
+ 2
499
+ 49
500
+ 9
501
+ 1
502
+ 15
503
+ 11
504
+ I
505
+ 8
506
+ I
507
+ 3
508
+ I
509
+ 1
510
+ I
511
+ 2
512
+ n
513
+ p
514
+ 11
515
+ s
516
+ 6
517
+ config
518
+ x
519
+ 9
520
+ file_path
521
+ x
522
+ 4
523
+ File
524
+ n
525
+ s
526
+ 1
527
+ w
528
+ M
529
+ 1
530
+ p
531
+ 2
532
+ x
533
+ 9
534
+ for_block
535
+ t
536
+ n
537
+ x
538
+ 16
539
+ with_config_file
540
+ i
541
+ 32
542
+ 57
543
+ 19
544
+ 0
545
+ 15
546
+ 20
547
+ 0
548
+ 21
549
+ 1
550
+ 0
551
+ 45
552
+ 0
553
+ 1
554
+ 49
555
+ 2
556
+ 1
557
+ 9
558
+ 22
559
+ 21
560
+ 1
561
+ 0
562
+ 8
563
+ 28
564
+ 21
565
+ 1
566
+ 0
567
+ 49
568
+ 3
569
+ 0
570
+ 49
571
+ 4
572
+ 1
573
+ 11
574
+ I
575
+ 5
576
+ I
577
+ 1
578
+ I
579
+ 1
580
+ I
581
+ 1
582
+ n
583
+ p
584
+ 5
585
+ x
586
+ 6
587
+ String
588
+ n
589
+ x
590
+ 5
591
+ is_a?
592
+ x
593
+ 7
594
+ to_yaml
595
+ x
596
+ 5
597
+ write
598
+ p
599
+ 3
600
+ I
601
+ 0
602
+ I
603
+ 12
604
+ I
605
+ 20
606
+ x
607
+ 60
608
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
609
+ p
610
+ 1
611
+ x
612
+ 1
613
+ f
614
+ x
615
+ 4
616
+ open
617
+ x
618
+ 9
619
+ FileUtils
620
+ n
621
+ x
622
+ 2
623
+ rm
624
+ n
625
+ p
626
+ 11
627
+ I
628
+ 0
629
+ I
630
+ 10
631
+ I
632
+ a
633
+ I
634
+ 11
635
+ I
636
+ 1b
637
+ I
638
+ 12
639
+ I
640
+ 29
641
+ I
642
+ 13
643
+ I
644
+ 33
645
+ I
646
+ 15
647
+ I
648
+ 48
649
+ x
650
+ 60
651
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
652
+ p
653
+ 3
654
+ x
655
+ 4
656
+ conf
657
+ x
658
+ 4
659
+ file
660
+ x
661
+ 4
662
+ path
663
+ x
664
+ 9
665
+ file_path
666
+ M
667
+ 1
668
+ n
669
+ n
670
+ x
671
+ 9
672
+ file_path
673
+ i
674
+ 20
675
+ 45
676
+ 0
677
+ 1
678
+ 5
679
+ 48
680
+ 2
681
+ 20
682
+ 0
683
+ 47
684
+ 49
685
+ 3
686
+ 0
687
+ 7
688
+ 4
689
+ 63
690
+ 2
691
+ 49
692
+ 5
693
+ 2
694
+ 11
695
+ I
696
+ 5
697
+ I
698
+ 1
699
+ I
700
+ 1
701
+ I
702
+ 1
703
+ n
704
+ p
705
+ 6
706
+ x
707
+ 4
708
+ File
709
+ n
710
+ x
711
+ 11
712
+ scratch_dir
713
+ x
714
+ 4
715
+ to_s
716
+ s
717
+ 4
718
+ .yml
719
+ x
720
+ 4
721
+ join
722
+ p
723
+ 5
724
+ I
725
+ 0
726
+ I
727
+ 18
728
+ I
729
+ 0
730
+ I
731
+ 19
732
+ I
733
+ 14
734
+ x
735
+ 60
736
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
737
+ p
738
+ 1
739
+ x
740
+ 4
741
+ file
742
+ x
743
+ 11
744
+ scratch_dir
745
+ M
746
+ 1
747
+ n
748
+ n
749
+ x
750
+ 11
751
+ scratch_dir
752
+ i
753
+ 22
754
+ 39
755
+ 0
756
+ 13
757
+ 10
758
+ 21
759
+ 15
760
+ 45
761
+ 1
762
+ 2
763
+ 7
764
+ 3
765
+ 64
766
+ 65
767
+ 49
768
+ 4
769
+ 0
770
+ 49
771
+ 5
772
+ 2
773
+ 38
774
+ 0
775
+ 11
776
+ I
777
+ 3
778
+ I
779
+ 0
780
+ I
781
+ 0
782
+ I
783
+ 0
784
+ n
785
+ p
786
+ 6
787
+ x
788
+ 12
789
+ @scratch_dir
790
+ x
791
+ 4
792
+ File
793
+ n
794
+ s
795
+ 10
796
+ ../scratch
797
+ x
798
+ 11
799
+ active_path
800
+ x
801
+ 11
802
+ expand_path
803
+ p
804
+ 5
805
+ I
806
+ 0
807
+ I
808
+ 1c
809
+ I
810
+ 0
811
+ I
812
+ 1d
813
+ I
814
+ 16
815
+ x
816
+ 60
817
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
818
+ p
819
+ 0
820
+ x
821
+ 10
822
+ with_const
823
+ M
824
+ 1
825
+ n
826
+ n
827
+ x
828
+ 10
829
+ with_const
830
+ i
831
+ 25
832
+ 45
833
+ 0
834
+ 1
835
+ 20
836
+ 0
837
+ 20
838
+ 1
839
+ 49
840
+ 2
841
+ 2
842
+ 15
843
+ 60
844
+ 0
845
+ 15
846
+ 45
847
+ 0
848
+ 3
849
+ 7
850
+ 4
851
+ 20
852
+ 0
853
+ 49
854
+ 5
855
+ 2
856
+ 11
857
+ I
858
+ 5
859
+ I
860
+ 2
861
+ I
862
+ 2
863
+ I
864
+ 2
865
+ n
866
+ p
867
+ 6
868
+ x
869
+ 6
870
+ Object
871
+ n
872
+ x
873
+ 9
874
+ const_set
875
+ n
876
+ x
877
+ 12
878
+ remove_const
879
+ x
880
+ 4
881
+ send
882
+ p
883
+ 9
884
+ I
885
+ 0
886
+ I
887
+ 20
888
+ I
889
+ 0
890
+ I
891
+ 21
892
+ I
893
+ b
894
+ I
895
+ 22
896
+ I
897
+ e
898
+ I
899
+ 23
900
+ I
901
+ 19
902
+ x
903
+ 60
904
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
905
+ p
906
+ 2
907
+ x
908
+ 5
909
+ const
910
+ x
911
+ 5
912
+ value
913
+ p
914
+ 11
915
+ I
916
+ 2
917
+ I
918
+ a
919
+ I
920
+ 10
921
+ I
922
+ 10
923
+ I
924
+ 1e
925
+ I
926
+ 18
927
+ I
928
+ 2c
929
+ I
930
+ 1c
931
+ I
932
+ 3a
933
+ I
934
+ 20
935
+ I
936
+ 48
937
+ x
938
+ 60
939
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
940
+ p
941
+ 0
942
+ x
943
+ 13
944
+ attach_method
945
+ x
946
+ 8
947
+ TestCase
948
+ x
949
+ 8
950
+ MiniTest
951
+ n
952
+ x
953
+ 4
954
+ Unit
955
+ x
956
+ 16
957
+ open_class_under
958
+ x
959
+ 14
960
+ __class_init__
961
+ M
962
+ 1
963
+ n
964
+ n
965
+ x
966
+ 8
967
+ TestCase
968
+ i
969
+ 13
970
+ 5
971
+ 66
972
+ 5
973
+ 45
974
+ 0
975
+ 1
976
+ 43
977
+ 2
978
+ 47
979
+ 49
980
+ 3
981
+ 1
982
+ 11
983
+ I
984
+ 2
985
+ I
986
+ 0
987
+ I
988
+ 0
989
+ I
990
+ 0
991
+ n
992
+ p
993
+ 4
994
+ x
995
+ 7
996
+ Configy
997
+ n
998
+ x
999
+ 11
1000
+ TestHelpers
1001
+ x
1002
+ 7
1003
+ include
1004
+ p
1005
+ 3
1006
+ I
1007
+ 2
1008
+ I
1009
+ 29
1010
+ I
1011
+ d
1012
+ x
1013
+ 60
1014
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
1015
+ p
1016
+ 0
1017
+ p
1018
+ 19
1019
+ I
1020
+ 0
1021
+ I
1022
+ 1
1023
+ I
1024
+ 9
1025
+ I
1026
+ 2
1027
+ I
1028
+ 12
1029
+ I
1030
+ 3
1031
+ I
1032
+ 1b
1033
+ I
1034
+ 4
1035
+ I
1036
+ 24
1037
+ I
1038
+ 5
1039
+ I
1040
+ 2d
1041
+ I
1042
+ 6
1043
+ I
1044
+ 36
1045
+ I
1046
+ 7
1047
+ I
1048
+ 3f
1049
+ I
1050
+ 9
1051
+ I
1052
+ 5b
1053
+ I
1054
+ 28
1055
+ I
1056
+ 7c
1057
+ x
1058
+ 60
1059
+ /Users/gabevarela/work/ruby/gems/configy/test/test_helper.rb
1060
+ p
1061
+ 0