cascading-configuration-array 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +29 -312
- data/README.rdoc +25 -1
- data/lib/cascading-configuration/CascadingConfiguration.rb +16 -0
- data/lib/cascading-configuration.rb +15 -0
- data/spec/CascadingConfiguration_spec.rb +224 -0
- metadata +5 -16
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/Accessors.rb +0 -38
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/ClassInstance.rb +0 -19
- data/lib/cascading-configuration-array/CascadingConfiguration/Array/ModuleInstance.rb +0 -36
- data/lib/cascading-configuration-array/CascadingConfiguration/Array.rb +0 -24
- data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray/Instance.rb +0 -39
- data/lib/cascading-configuration-array/CascadingConfiguration/CompositingArray.rb +0 -216
- data/lib/cascading-configuration-array/CascadingConfiguration/LocalConfigurationArray.rb +0 -166
- data/lib/cascading-configuration-array/CascadingConfiguration/_private_/CompositingArray.rb +0 -57
- data/lib/cascading-configuration-array/CascadingConfiguration/_private_/LocalConfigurationArray.rb +0 -26
- data/lib/cascading-configuration-array.rb +0 -35
- data/spec/CascadingConfiguration/Array/Accessors_spec.rb +0 -28
- data/spec/CascadingConfiguration/Array_spec.rb +0 -90
- data/spec/CascadingConfiguration/CompositingArray_spec.rb +0 -519
- data/spec/CascadingConfiguration/LocalConfigurationArray_spec.rb +0 -155
@@ -1,155 +0,0 @@
|
|
1
|
-
|
2
|
-
require_relative '../../lib/cascading-configuration-array.rb'
|
3
|
-
|
4
|
-
describe CascadingConfiguration::LocalConfigurationArray do
|
5
|
-
|
6
|
-
#########
|
7
|
-
# []= #
|
8
|
-
#########
|
9
|
-
|
10
|
-
it 'can add elements' do
|
11
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
12
|
-
array_instance[0] = :some_setting
|
13
|
-
array_instance.should == [ :some_setting ]
|
14
|
-
array_instance.exclude_array.include?( :some_setting ).should == false
|
15
|
-
array_instance[1] = :other_setting
|
16
|
-
array_instance.should == [ :other_setting, :some_setting ]
|
17
|
-
array_instance.exclude_array.include?( :other_setting ).should == false
|
18
|
-
end
|
19
|
-
|
20
|
-
########
|
21
|
-
# << #
|
22
|
-
########
|
23
|
-
|
24
|
-
it 'can add elements' do
|
25
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
26
|
-
array_instance << :some_setting
|
27
|
-
array_instance.should == [ :some_setting ]
|
28
|
-
array_instance.exclude_array.include?( :some_setting ).should == false
|
29
|
-
array_instance << :other_setting
|
30
|
-
array_instance.should == [ :other_setting, :some_setting ]
|
31
|
-
array_instance.exclude_array.include?( :other_setting ).should == false
|
32
|
-
end
|
33
|
-
|
34
|
-
#######
|
35
|
-
# + #
|
36
|
-
#######
|
37
|
-
|
38
|
-
it 'can add elements' do
|
39
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
40
|
-
array_instance += [ :some_setting ]
|
41
|
-
array_instance.should == [ :some_setting ]
|
42
|
-
array_instance.exclude_array.include?( :some_setting ).should == false
|
43
|
-
array_instance += [ :other_setting ]
|
44
|
-
array_instance.should == [ :other_setting, :some_setting ]
|
45
|
-
array_instance.exclude_array.include?( :other_setting ).should == false
|
46
|
-
end
|
47
|
-
|
48
|
-
##########
|
49
|
-
# push #
|
50
|
-
##########
|
51
|
-
|
52
|
-
it 'can add elements' do
|
53
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
54
|
-
array_instance.push( :some_setting )
|
55
|
-
array_instance.should == [ :some_setting ]
|
56
|
-
array_instance.exclude_array.include?( :some_setting ).should == false
|
57
|
-
array_instance.push( :other_setting )
|
58
|
-
array_instance.should == [ :other_setting, :some_setting ]
|
59
|
-
array_instance.exclude_array.include?( :other_setting ).should == false
|
60
|
-
end
|
61
|
-
|
62
|
-
############
|
63
|
-
# concat #
|
64
|
-
############
|
65
|
-
|
66
|
-
it 'can concat arrays' do
|
67
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
68
|
-
array_instance.concat( [ :some_setting ] )
|
69
|
-
array_instance.should == [ :some_setting ]
|
70
|
-
array_instance.exclude_array.include?( :some_setting ).should == false
|
71
|
-
array_instance.concat( [ :other_setting ] )
|
72
|
-
array_instance.should == [ :other_setting, :some_setting ]
|
73
|
-
array_instance.exclude_array.include?( :other_setting ).should == false
|
74
|
-
end
|
75
|
-
|
76
|
-
#######
|
77
|
-
# - #
|
78
|
-
#######
|
79
|
-
|
80
|
-
it 'can exclude elements' do
|
81
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
82
|
-
array_instance += [ :some_setting, :other_setting ]
|
83
|
-
array_instance -= [ :other_setting ]
|
84
|
-
array_instance.should == [ :some_setting ]
|
85
|
-
array_instance.exclude_array.include?( :other_setting ).should == true
|
86
|
-
array_instance -= [ :some_setting ]
|
87
|
-
array_instance.should == []
|
88
|
-
array_instance.exclude_array.include?( :some_setting ).should == true
|
89
|
-
end
|
90
|
-
|
91
|
-
############
|
92
|
-
# delete #
|
93
|
-
############
|
94
|
-
|
95
|
-
it 'can exclude elements' do
|
96
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
97
|
-
array_instance += [ :some_setting, :other_setting ]
|
98
|
-
array_instance.delete( :other_setting )
|
99
|
-
array_instance.should == [ :some_setting ]
|
100
|
-
array_instance.exclude_array.include?( :other_setting ).should == true
|
101
|
-
array_instance.delete( :some_setting )
|
102
|
-
array_instance.should == []
|
103
|
-
array_instance.exclude_array.include?( :some_setting ).should == true
|
104
|
-
end
|
105
|
-
|
106
|
-
#########
|
107
|
-
# pop #
|
108
|
-
#########
|
109
|
-
|
110
|
-
it 'can pop the final element' do
|
111
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
112
|
-
array_instance += [ :other_setting, :some_setting ]
|
113
|
-
array_instance.pop.should == :some_setting
|
114
|
-
array_instance.should == [ :other_setting ]
|
115
|
-
array_instance.exclude_array.include?( :some_setting ).should == true
|
116
|
-
end
|
117
|
-
|
118
|
-
###########
|
119
|
-
# shift #
|
120
|
-
###########
|
121
|
-
|
122
|
-
it 'can shift the first element' do
|
123
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
124
|
-
array_instance += [ :other_setting, :some_setting ]
|
125
|
-
array_instance.shift.should == :other_setting
|
126
|
-
array_instance.should == [ :some_setting ]
|
127
|
-
array_instance.exclude_array.include?( :other_setting ).should == true
|
128
|
-
end
|
129
|
-
|
130
|
-
############
|
131
|
-
# slice! #
|
132
|
-
############
|
133
|
-
|
134
|
-
it 'can slice elements' do
|
135
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
136
|
-
array_instance += [ :other_setting, :some_setting ]
|
137
|
-
array_instance.slice!( 0, 1 ).should == [ :other_setting ]
|
138
|
-
array_instance.should == [ :some_setting ]
|
139
|
-
array_instance.exclude_array.include?( :other_setting ).should == true
|
140
|
-
end
|
141
|
-
|
142
|
-
###########
|
143
|
-
# clear #
|
144
|
-
###########
|
145
|
-
|
146
|
-
it 'can clear, causing present elements to be excluded' do
|
147
|
-
array_instance = CascadingConfiguration::LocalConfigurationArray.new
|
148
|
-
array_instance += [ :some_setting, :other_setting ]
|
149
|
-
array_instance.clear
|
150
|
-
array_instance.should == []
|
151
|
-
array_instance.exclude_array.include?( :some_setting ).should == true
|
152
|
-
array_instance.exclude_array.include?( :other_setting ).should == true
|
153
|
-
end
|
154
|
-
|
155
|
-
end
|