@@ -249,8 +249,8 @@ def nested_configuration_example conf
249
249
conf . alpha . bravo . charlie true
250
250
end . to_not raise_error
251
251
conf . should_not be_nil
252
- conf . alpha . bravo . _parent . should be conf . alpha
253
- conf . alpha . _parent . should be conf
252
+ conf . alpha . bravo . send ( : _parent) . should be conf . alpha
253
+ conf . alpha . send ( : _parent) . should be conf
254
254
conf . _parent . should be_nil
255
255
end
256
256
@@ -261,7 +261,7 @@ def nested_configuration_example conf
261
261
conf . alpha Configuration . new , Configuration . new , Configuration . new
262
262
end . to_not raise_error
263
263
conf . should_not be_nil
264
- conf . alpha . each { |child | child . _parent . should be conf }
264
+ conf . alpha . each { |child | child . send ( : _parent) . should be conf }
265
265
conf . _parent . should be_nil
266
266
end
267
267
@@ -787,36 +787,40 @@ def nested_configuration_example conf
787
787
788
788
end # mode of usage
789
789
790
- it 'can merge! configurations' do
791
- orig = simple_explicit_configuration
792
- orig . echo :original1
793
- orig . foxtrot :original2
794
- other = Configuration . new do
795
- foxtrot :overridden
796
- hotel :new
797
- end
798
- conf = orig . _merge! other
799
- simple_configuration_example conf
800
- conf . echo . should be :original1
801
- conf . hotel . should be :new
802
- conf . foxtrot . should be :overridden
803
- conf . should be orig
804
- end
790
+ context 'merge' do
791
+
792
+ it 'can update its own configuration' do
793
+ orig = simple_explicit_configuration
794
+ orig . echo :original1
795
+ orig . foxtrot :original2
796
+ other = Configuration . new do
797
+ foxtrot :overridden
798
+ hotel :new
799
+ end
800
+ conf = orig . _merge! other
801
+ simple_configuration_example conf
802
+ conf . echo . should be :original1
803
+ conf . hotel . should be :new
804
+ conf . foxtrot . should be :overridden
805
+ conf . should be orig
806
+ end
807
+
808
+ it 'can create a new configuration' do
809
+ orig = simple_explicit_configuration
810
+ orig . echo :original1
811
+ orig . foxtrot :original2
812
+ other = Configuration . new do
813
+ foxtrot :overridden
814
+ hotel :new
815
+ end
816
+ conf = orig . _merge other
817
+ simple_configuration_example conf
818
+ conf . echo . should be :original1
819
+ conf . hotel . should be :new
820
+ conf . foxtrot . should be :overridden
821
+ conf . should_not be orig
822
+ end
805
823
806
- it 'can merge configurations' do
807
- orig = simple_explicit_configuration
808
- orig . echo :original1
809
- orig . foxtrot :original2
810
- other = Configuration . new do
811
- foxtrot :overridden
812
- hotel :new
813
- end
814
- conf = orig . _merge other
815
- simple_configuration_example conf
816
- conf . echo . should be :original1
817
- conf . hotel . should be :new
818
- conf . foxtrot . should be :overridden
819
- conf . should_not be orig
820
824
end
821
825
822
826
end
0 commit comments