Skip to content

Commit 50540e3

Browse files
committed
Add count to the reserved names list
1 parent fb7d4b8 commit 50540e3

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

lib/config/options.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def merge!(hash)
131131
end
132132

133133
# Some keywords that don't play nicely with OpenStruct
134-
SETTINGS_RESERVED_NAMES = %w{select collect test}
134+
SETTINGS_RESERVED_NAMES = %w{select collect test count}
135135

136136
# An alternative mechanism for property access.
137137
# This let's you do foo['bar'] along with foo.bar.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
select: 123
22
collect: 456
3+
count: 789

spec/options_spec.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
it 'should allow to access them via object member notation' do
1111
expect(config.select).to eq(123)
1212
expect(config.collect).to eq(456)
13+
expect(config.count).to eq(789)
1314
end
1415

1516
it 'should allow to access them using [] operator' do
1617
expect(config['select']).to eq(123)
1718
expect(config['collect']).to eq(456)
19+
expect(config['count']).to eq(789)
1820

1921
expect(config[:select]).to eq(123)
2022
expect(config[:collect]).to eq(456)
23+
expect(config[:count]).to eq(789)
2124
end
2225
end
2326

0 commit comments

Comments
 (0)