diff --git a/lib/config/options.rb b/lib/config/options.rb index 0c3e9e32..92e8c2b0 100644 --- a/lib/config/options.rb +++ b/lib/config/options.rb @@ -131,7 +131,7 @@ def merge!(hash) end # Some keywords that don't play nicely with OpenStruct - SETTINGS_RESERVED_NAMES = %w{select collect test} + SETTINGS_RESERVED_NAMES = %w{select collect test count} # An alternative mechanism for property access. # This let's you do foo['bar'] along with foo.bar. diff --git a/spec/fixtures/reserved_keywords.yml b/spec/fixtures/reserved_keywords.yml index c00d4b1a..0ac0c37d 100644 --- a/spec/fixtures/reserved_keywords.yml +++ b/spec/fixtures/reserved_keywords.yml @@ -1,2 +1,3 @@ select: 123 collect: 456 +count: 789 diff --git a/spec/options_spec.rb b/spec/options_spec.rb index 86cf6f94..4ac1ea99 100644 --- a/spec/options_spec.rb +++ b/spec/options_spec.rb @@ -10,14 +10,17 @@ it 'should allow to access them via object member notation' do expect(config.select).to eq(123) expect(config.collect).to eq(456) + expect(config.count).to eq(789) end it 'should allow to access them using [] operator' do expect(config['select']).to eq(123) expect(config['collect']).to eq(456) + expect(config['count']).to eq(789) expect(config[:select]).to eq(123) expect(config[:collect]).to eq(456) + expect(config[:count]).to eq(789) end end