Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
254 additions
and
15 deletions.
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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
require 'helper' | ||
require 'rbconfig' | ||
require 'byebug' | ||
|
||
require 'minitest/hell' | ||
class Minitest::Test | ||
|
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
7 changes: 7 additions & 0 deletions
7
test/unit/mock/profiles/dupe-controls/child/controls/child.rb
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,7 @@ | ||
control 'control-01' do | ||
title 'the title set in child' | ||
description 'something' | ||
describe 'describe-01' do | ||
it { should include '01' } | ||
end | ||
end |
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,10 @@ | ||
name: child | ||
title: A simple profile to test inheritance with duplicate control ids | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: you@example.com | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
supports: | ||
platform: os |
25 changes: 25 additions & 0 deletions
25
test/unit/mock/profiles/dupe-controls/simple/controls/duplicates.rb
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,25 @@ | ||
control 'dupe-01' do | ||
impact 1 | ||
title 'dupe-01-title-one' | ||
description 'something' | ||
|
||
desc 'collision', 'one' | ||
desc 'uniq-one', 'one' | ||
|
||
describe true do | ||
it { should eq false } | ||
end | ||
end | ||
|
||
control 'dupe-01' do | ||
impact 0 | ||
title 'dupe-01-title-two' | ||
description 'something' | ||
|
||
desc 'collision', 'two' | ||
desc 'uniq-two', 'two' | ||
|
||
describe true do | ||
it { should eq true } | ||
end | ||
end |
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,10 @@ | ||
name: dupe-controls | ||
title: A profile containing duplicated controls, refs github issue 822 | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: you@example.com | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
supports: | ||
platform: os |
14 changes: 14 additions & 0 deletions
14
test/unit/mock/profiles/dupe-controls/wrapper-block-include/controls/include.rb
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,14 @@ | ||
include_controls 'child' do | ||
control 'control-01' do | ||
title 'title set in wrapper-block-include, inside the block' | ||
description 'something' | ||
end | ||
end | ||
|
||
control 'control-01' do | ||
title 'the title set in wrapper-block-include, outside the block' | ||
description 'something' | ||
describe 'describe-01' do | ||
it { should include '01' } | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
test/unit/mock/profiles/dupe-controls/wrapper-block-include/inspec.yml
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,13 @@ | ||
name: wrapper-simple-include | ||
title: A simple InSpec Profile to test inheritance with duplicate control IDs with an include block | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: you@example.com | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
supports: | ||
platform: os | ||
depends: | ||
- name: child | ||
path: ../child |
9 changes: 9 additions & 0 deletions
9
test/unit/mock/profiles/dupe-controls/wrapper-simple-include/controls/include.rb
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,9 @@ | ||
include_controls 'child' | ||
|
||
control 'control-01' do | ||
title 'the title set in wrapper-simple-include' | ||
description 'something' | ||
describe 'describe-01' do | ||
it { should include '01' } | ||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
test/unit/mock/profiles/dupe-controls/wrapper-simple-include/inspec.yml
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,13 @@ | ||
name: wrapper-simple-include | ||
title: A simple InSpec Profile to test inheritance with duplicate control IDs with a bare include | ||
maintainer: The Authors | ||
copyright: The Authors | ||
copyright_email: you@example.com | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile | ||
version: 0.1.0 | ||
supports: | ||
platform: os | ||
depends: | ||
- name: child | ||
path: ../child |
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