spec/configurability/config_spec.rb in configurability-1.0.4 vs spec/configurability/config_spec.rb in configurability-1.0.5
- old
+ new
@@ -92,9 +92,26 @@
config = Configurability::Config.new( TEST_CONFIG )
config[:section]['subsection'][:subsubsection].should == 'value'
end
+ NIL_KEY_CONFIG = %{
+ ---
+ trap_on:
+ "low disk space alert":
+ ~:
+ notepad:
+ patterns:
+ - pattern1
+ - pattern2
+ }.gsub(/^\t/, '')
+
+ it "handles nil as a key in the configuration (issue #1)" do
+ config = Configurability::Config.new( NIL_KEY_CONFIG )
+ config[:trap_on]['low disk space alert'][nil][:notepad][:patterns].should == [ 'pattern1', 'pattern2' ]
+ end
+
+
describe "created with in-memory YAML source" do
before(:each) do
@config = Configurability::Config.new( TEST_CONFIG )
end