-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BAM: Add element types on violations to difference parameters from re…
…sources (#96) * BAM: Added line numbers and logical resource id to Parameters * Add specs * BAM: Add element type functionality to difference parameters from resources * BAM: Add basic test for element_types
- Loading branch information
1 parent
683d538
commit 3ca8460
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require 'spec_helper' | ||
require 'cfn-model/parser/cfn_parser' | ||
|
||
describe CfnParser do | ||
before :each do | ||
@cfn_parser = CfnParser.new | ||
end | ||
|
||
context 'element types enabled' do | ||
it 'returns model with element_types for each resource' do | ||
cloudformation_template_yml = IO.read(yaml_test_templates('iam_user/iam_user_with_literal_username_and_addition').first) | ||
actual_cfn_model = @cfn_parser.parse cloudformation_template_yml, nil, true | ||
expected_element_types = { | ||
"AccessKey" => "parameter", | ||
"iamUserWithAddition" => "resource", | ||
"groupA" => "resource", | ||
"addition1" => "resource", | ||
"addition2" => "resource" | ||
} | ||
expect(actual_cfn_model.element_types).to eq expected_element_types | ||
end | ||
end | ||
end |