-
Notifications
You must be signed in to change notification settings - Fork 0
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
5 changed files
with
113 additions
and
94 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
10 changes: 5 additions & 5 deletions
10
puppet-lint-global_resource-check.gemspec → puppet-lint-global_definition-check.gemspec
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,59 @@ | ||
require "spec_helper" | ||
|
||
describe "global_resource" do | ||
context "just a class" do | ||
let(:code) { "class test { file { 'file': } }" } | ||
|
||
it "should not detect any problems" do | ||
expect(problems).to have(0).problems | ||
end | ||
end | ||
|
||
context "just a define" do | ||
let(:code) { "define test ($param = undef) { file { 'file': } }" } | ||
|
||
it "should not detect any problems" do | ||
expect(problems).to have(0).problems | ||
end | ||
end | ||
|
||
context "allow node resources" do | ||
let(:code) { "node 'test' { file { 'file': } }" } | ||
|
||
it "should not detect any problems" do | ||
expect(problems).to have(0).problems | ||
end | ||
end | ||
|
||
context "global file" do | ||
let(:code) do | ||
"file { 'file': } define test ($param = undef) { file { 'file': } }" | ||
end | ||
|
||
it "should detect a problem" do | ||
expect(problems).to have(1).problems | ||
end | ||
end | ||
|
||
context "global includes" do | ||
let(:code) { "class test { file { 'file': } } \ninclude testclass" } | ||
|
||
it "should detect a problem" do | ||
expect(problems).to have(1).problems | ||
end | ||
end | ||
|
||
context "global defaults" do | ||
let(:code) do | ||
<<-EOS | ||
Exec { | ||
path => '/usr/bin:/usr/sbin/:/bin:/sbin', | ||
} | ||
EOS | ||
end | ||
|
||
it "should not detect any problems" do | ||
expect(problems).to have(0).problems | ||
end | ||
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