Skip to content

Commit c59d105

Browse files
authored
Additional tests for parsing values (#296)
1 parent d2c5356 commit c59d105

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

spec/fixtures/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ databases:
1212
# ...
1313
#
1414
size: 1
15+
number_in_quotes: "2.56"
1516
server: google.com
1617
1: "one"
1718
photo_sizes:

spec/options_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,4 +239,18 @@
239239
expect(options.as_json).to eq({ 'foo' => 'bar' })
240240
end
241241
end
242+
243+
context 'parsing values' do
244+
let(:config) do
245+
Config.load_files("#{fixture_path}/settings.yml")
246+
end
247+
248+
it 'should return number when its specified without quotes' do
249+
expect(config['size']).to eq(1)
250+
end
251+
252+
it 'should return string when number specified with quotes' do
253+
expect(config['number_in_quotes']).to eq("2.56")
254+
end
255+
end
242256
end

0 commit comments

Comments
 (0)