2018-06-26 11:48:20 +00:00
|
|
|
expecteds = {
|
|
|
|
an_integer: 1,
|
|
|
|
a_quoted_string: 'Should not have quotes',
|
|
|
|
an_unquoted_string: 'Should not have quotes',
|
|
|
|
lowercase_true: true,
|
|
|
|
titlecase_true: true,
|
|
|
|
titlecase_false: false,
|
|
|
|
}
|
|
|
|
tests = expecteds.keys.map do |test_name|
|
|
|
|
{
|
|
|
|
name: test_name,
|
|
|
|
expected: expecteds[test_name],
|
2019-02-12 23:02:54 +00:00
|
|
|
input_via_string: attribute(test_name.to_s, value: "#{test_name}_default"),
|
|
|
|
input_via_symbol: attribute(test_name, value: "#{test_name}_default"),
|
2018-06-26 11:48:20 +00:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
control 'flat' do
|
|
|
|
tests.each do |info|
|
|
|
|
describe "#{info[:name]} using string key" do
|
2019-02-12 23:02:54 +00:00
|
|
|
subject { info[:input_via_string] }
|
2018-06-26 11:48:20 +00:00
|
|
|
it { should eq info[:expected] }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|