puppet-lint-reference_on_declaration_outside_of_class-check 1.0.8 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f58019a41dba9734b248d9948d161ca1a6667c8
4
- data.tar.gz: 853ced4f419b00481ae4053c59a668c5d71492ee
3
+ metadata.gz: cb3a2a8ca764f6d767353e40a00c1c6754431ae2
4
+ data.tar.gz: 1ddc9e80ece4791e5a9f19feafd58d8e77305e18
5
5
  SHA512:
6
- metadata.gz: c0f3b11ba2c770c908d8693257ea61841c9f28625b464dd7e5ea9acb0088a9edce1b32143dfd7f5f1fd5971649b0a86a7e19431751068124b7ec62fd4cc57267
7
- data.tar.gz: b92dcb7d4858f70d16530c275aed5f42ccbe11956005747ba13da0cd81a0fc8d9aee776a9e7ff33f3a2cf45e017bebc3efed790a46888dca8e1d904e415552c1
6
+ metadata.gz: 3d125b5df110b98527c28f335031f65c64e5f8d4ce971129853f756719f7305d4a573b68a3a2acb3c2544ac5c167f0bcea63ce6acb80de2e0eba2c1c57f8c8dc
7
+ data.tar.gz: 41b8d014246d4156a9486c1b6b3e160dd0ad36b937d7cb1f73ea8fe5524802989f9742d9dfccfc47d12adf41bc710100e4ba30ffcad9af2898739b03f312fc69
@@ -16,6 +16,20 @@ describe 'reference_on_foreign_class' do
16
16
  end
17
17
  end
18
18
 
19
+ context 'a proper reference on a local class include using a variable' do
20
+ let(:code) { "
21
+ class demo {
22
+ include $install
23
+ include $config
24
+ Class[$config] -> Class[$install]
25
+ }
26
+ " }
27
+
28
+ it 'should detect no problem' do
29
+ expect(problems).to have(0).problem
30
+ end
31
+ end
32
+
19
33
  context 'a proper reference on a local class type declaration' do
20
34
  let(:code) { "
21
35
  class demo2 {
@@ -30,6 +44,20 @@ describe 'reference_on_foreign_class' do
30
44
  end
31
45
  end
32
46
 
47
+ context 'a proper reference on a local class type declaration using a variable' do
48
+ let(:code) { "
49
+ class demo2 {
50
+ class { $install: }
51
+ class { $config: }
52
+ Class[$config] -> Class[$install]
53
+ }
54
+ " }
55
+
56
+ it 'should detect no problem' do
57
+ expect(problems).to have(0).problem
58
+ end
59
+ end
60
+
33
61
 
34
62
  context 'a reference on a foreign class declaration' do
35
63
  let(:msg) { 'reference on a foreign class' }
@@ -38,7 +66,39 @@ describe 'reference_on_foreign_class' do
38
66
  Class['demo'] -> Class['foo']
39
67
  " }
40
68
 
41
- it 'should only detect a single problem' do
69
+ it 'should detect two problems' do
70
+ expect(problems).to have(2).problem
71
+ end
72
+
73
+ it 'should create a warning' do
74
+ expect(problems).to contain_warning(msg)
75
+ end
76
+ end
77
+
78
+ context 'a reference on a foreign class declaration using a variable' do
79
+ let(:msg) { 'reference on a foreign class' }
80
+ let(:code) { "
81
+ include $base::demo
82
+ Class[$demo] -> Class[$foo]
83
+ " }
84
+
85
+ it 'should detect two problems' do
86
+ expect(problems).to have(2).problem
87
+ end
88
+
89
+ it 'should create a warning' do
90
+ expect(problems).to contain_warning(msg)
91
+ end
92
+ end
93
+
94
+ context 'a reference on a foreign class type declaration' do
95
+ let(:msg) { 'reference on a foreign class' }
96
+ let(:code) { "
97
+ class{ base::demo: }
98
+ Class['demo'] -> Class['foo']
99
+ " }
100
+
101
+ it 'should detect two problems' do
42
102
  expect(problems).to have(2).problem
43
103
  end
44
104
 
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-lint-reference_on_declaration_outside_of_class-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Alfke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-01 00:00:00.000000000 Z
11
+ date: 2016-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: puppet-lint
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: rspec
29
35
  requirement: !ruby/object:Gem::Requirement