puppet-lint-global_definition-check 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 83f49eb058c88589fba6ae40663949eedb9d23c76b4b0611b10b138569ad6a91
4
- data.tar.gz: 41b8e536eb95df3fdc0d3755dae5195f15bd906dfdd54bb4409cbed17809ec6b
3
+ metadata.gz: f5908dbc45cdfa0b23c1118581382b3b94b04d8e3698f97dfee048f88cc86afc
4
+ data.tar.gz: 126e6ae65e6ece7de91b78f6dcb231ed6d2afaa82ae92be496b58c7cb9e8cf68
5
5
  SHA512:
6
- metadata.gz: 16bc7ad6b276ad7491dbc5200929c6bb58e9a13f7af17cb1b6f84782c947e0d61c051a1d4fb9ef603b90c3f91853a5b3427b7da9f59d523b9d0ab3d295c5f234
7
- data.tar.gz: a955faeb4f1cef540723ab8f11c37e8c1fe96c3a52566a3c1e8809fe8026dab940b13c9a16b2bd2dc2b4debbc6499bc69e275b8cd052b7e8db0fa6b5b7bcfdec
6
+ metadata.gz: 697fca75eb244e8e6e86d7320538069da3682aa0a5093a4ef39cb16dd7c6c13c410dd595bfb33d76f31f709c61ad69230451aa913ec293b932f7968702da6484
7
+ data.tar.gz: 3de93b7fc97a05f656e54388ad7fb13aa377071450ee94f7f5dd46ea7fd06959b4a8bd90ca50530d0a601fd7b9a23764c12836fa217417a824de0c31f49fd33e
@@ -1,59 +1,33 @@
1
1
  require "spec_helper"
2
2
 
3
- describe "global_resource" do
4
- context "just a class" do
5
- let(:code) { "class test { file { 'file': } }" }
6
-
7
- it "should not detect any problems" do
8
- expect(problems).to have(0).problems
9
- end
10
- end
11
-
12
- context "just a define" do
13
- let(:code) { "define test ($param = undef) { file { 'file': } }" }
14
-
15
- it "should not detect any problems" do
16
- expect(problems).to have(0).problems
3
+ describe "global_function" do
4
+ context "just a function" do
5
+ let(:code) do
6
+ <<-EOS
7
+ class test {
8
+ ensure_packages(['wordpress']);
9
+ }
10
+ EOS
17
11
  end
18
- end
19
-
20
- context "allow node resources" do
21
- let(:code) { "node 'test' { file { 'file': } }" }
22
12
 
23
13
  it "should not detect any problems" do
24
14
  expect(problems).to have(0).problems
25
15
  end
26
16
  end
27
17
 
28
- context "global file" do
29
- let(:code) do
30
- "file { 'file': } define test ($param = undef) { file { 'file': } }"
31
- end
32
-
33
- it "should detect a problem" do
34
- expect(problems).to have(1).problems
35
- end
36
- end
37
-
38
- context "global includes" do
39
- let(:code) { "class test { file { 'file': } } \ninclude testclass" }
40
-
41
- it "should detect a problem" do
42
- expect(problems).to have(1).problems
43
- end
44
- end
45
-
46
- context "global defaults" do
18
+ context "global functions" do
47
19
  let(:code) do
48
20
  <<-EOS
49
- Exec {
50
- path => '/usr/bin:/usr/sbin/:/bin:/sbin',
21
+ class test {
22
+ ensure_packages(['wordpress']);
51
23
  }
24
+
25
+ ensure_packages(['wordpress']);
52
26
  EOS
53
27
  end
54
28
 
55
- it "should not detect any problems" do
56
- expect(problems).to have(0).problems
29
+ it "should detect a problem" do
30
+ expect(problems).to have(1).problems
57
31
  end
58
32
  end
59
33
  end
@@ -1,33 +1,59 @@
1
1
  require "spec_helper"
2
2
 
3
- describe "global_function" do
4
- context "just a function" do
5
- let(:code) do
6
- <<-EOS
7
- class test {
8
- ensure_packages(['wordpress']);
9
- }
10
- EOS
3
+ describe "global_resource" do
4
+ context "just a class" do
5
+ let(:code) { "class test { file { 'file': } }" }
6
+
7
+ it "should not detect any problems" do
8
+ expect(problems).to have(0).problems
11
9
  end
10
+ end
11
+
12
+ context "just a define" do
13
+ let(:code) { "define test ($param = undef) { file { 'file': } }" }
12
14
 
13
15
  it "should not detect any problems" do
14
16
  expect(problems).to have(0).problems
15
17
  end
16
18
  end
17
19
 
18
- context "global functions" do
20
+ context "allow node resources" do
21
+ let(:code) { "node 'test' { file { 'file': } }" }
22
+
23
+ it "should not detect any problems" do
24
+ expect(problems).to have(0).problems
25
+ end
26
+ end
27
+
28
+ context "global file" do
19
29
  let(:code) do
20
- <<-EOS
21
- class test {
22
- ensure_packages(['wordpress']);
23
- }
30
+ "file { 'file': } define test ($param = undef) { file { 'file': } }"
31
+ end
24
32
 
25
- ensure_packages(['wordpress']);
26
- EOS
33
+ it "should detect a problem" do
34
+ expect(problems).to have(1).problems
27
35
  end
36
+ end
37
+
38
+ context "global includes" do
39
+ let(:code) { "class test { file { 'file': } } \ninclude testclass" }
28
40
 
29
41
  it "should detect a problem" do
30
42
  expect(problems).to have(1).problems
31
43
  end
32
44
  end
45
+
46
+ context "global defaults" do
47
+ let(:code) do
48
+ <<-EOS
49
+ Exec {
50
+ path => '/usr/bin:/usr/sbin/:/bin:/sbin',
51
+ }
52
+ EOS
53
+ end
54
+
55
+ it "should not detect any problems" do
56
+ expect(problems).to have(0).problems
57
+ end
58
+ end
33
59
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-global_definition-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nine Internet Solutions AG
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-27 00:00:00.000000000 Z
11
+ date: 2023-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint