inspec/test/unit/mock/profiles/inputs/basic/controls/flat.rb
Clinton Wolfe f7d58ad92c Replace most mentions of attribute with input in test/
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-20 20:41:10 -05:00

25 lines
No EOL
656 B
Ruby

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],
input_via_string: attribute(test_name.to_s, value: "#{test_name}_default"),
input_via_symbol: attribute(test_name, value: "#{test_name}_default"),
}
end
control 'flat' do
tests.each do |info|
describe "#{info[:name]} using string key" do
subject { info[:input_via_string] }
it { should eq info[:expected] }
end
end
end