rspec-puppet 2.8.0 → 2.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +75 -19
- data/README.md +14 -0
- data/lib/rspec-puppet/adapters.rb +67 -1
- data/lib/rspec-puppet/facter_impl.rb +49 -0
- data/lib/rspec-puppet/matchers/count_generic.rb +5 -3
- data/lib/rspec-puppet/matchers/create_generic.rb +11 -8
- data/lib/rspec-puppet/matchers/include_class.rb +1 -1
- data/lib/rspec-puppet/matchers/type_matchers.rb +0 -3
- data/lib/rspec-puppet/sensitive.rb +5 -1
- data/lib/rspec-puppet/support.rb +7 -7
- data/lib/rspec-puppet.rb +1 -0
- metadata +13 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 841a21438e7d3927a8f136334b6ad6a189b1efa8e144eac94a55675d1a106cd1
|
4
|
+
data.tar.gz: fa95877eeb75e96db41ffc7025cc316de449884f7c1711d8ea0d5d6ae37d34d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51981b62e91d5fe7be774b715215965216b118c87ef2d6f79e941dcfe961e113e38dec4adc88ddd6e042d7efdb3c333e493dc779c3bea842bd163d1d7f711c76
|
7
|
+
data.tar.gz: f0297af0f3738a0fc0ba1c8f69e18951839f46e70d5f4132c9d414b71f1ead89632a9a0aa8a0ef277cb06ccd530777564bd2cd4e68ab22d21f98bb32ab8b5c15
|
data/CHANGELOG.md
CHANGED
@@ -2,13 +2,37 @@
|
|
2
2
|
All notable changes to this project will be documented in this file. This
|
3
3
|
project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [2.11.1]
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* Ensure FacterImpl consistency between example groups ([#19](https://github.com/puppetlabs/rspec-puppet/pull/19))
|
9
|
+
|
10
|
+
## [2.11.0]
|
11
|
+
|
12
|
+
### Added
|
13
|
+
* Add setting to use custom Facter implementation ([GH-16](https://github.com/puppetlabs/rspec-puppet/pull/16))
|
14
|
+
|
15
|
+
## [2.10.0]
|
16
|
+
The release sees rspec-puppet move into the puppetlabs namespace
|
17
|
+
|
18
|
+
### Added
|
19
|
+
* Add ruby 3 support ([GH-11](https://github.com/puppetlabs/rspec-puppet/pull/11))
|
20
|
+
|
21
|
+
## [2.9.0]
|
22
|
+
|
23
|
+
### Added
|
24
|
+
* Allow users to disable app_management for Puppet 4
|
25
|
+
* Added support for regexp arguments to Sensitive
|
26
|
+
* Handle all auto*, not just autorequire
|
27
|
+
* Set up loaders so that 4.x functions resolve properly
|
28
|
+
|
5
29
|
## [2.8.0]
|
6
30
|
|
7
31
|
### Breaking Changes
|
8
32
|
* As of the 2.8.0 release, the `rspec-puppet` project no longer guarantees compatibility
|
9
33
|
with Puppet 2.x or 3.x (running under Ruby 1.8.7) or Puppet 4.x (running under Ruby 1.9.3).
|
10
|
-
* This release adds support for the [`Sensitive`](https://puppet.com/docs/puppet/latest/lang_data_sensitive.html)
|
11
|
-
data type, however existing tests that were expecting `String` content may need to be updated
|
34
|
+
* This release adds support for the [`Sensitive`](https://puppet.com/docs/puppet/latest/lang_data_sensitive.html)
|
35
|
+
data type, however existing tests that were expecting `String` content may need to be updated
|
12
36
|
to wrap the expected value in the new `sensitive` helper:
|
13
37
|
|
14
38
|
```ruby
|
@@ -20,20 +44,20 @@ project adheres to [Semantic Versioning](http://semver.org/).
|
|
20
44
|
```
|
21
45
|
|
22
46
|
### Added
|
23
|
-
* Added support for [trusted external fact data](https://github.com/
|
24
|
-
* Added the ability to exclude resources from the coverage report calculations using a regular expression.
|
47
|
+
* Added support for [trusted external fact data](https://github.com/puppetlabs/rspec-puppet#specifying-trusted-external-data).
|
48
|
+
* Added the ability to exclude resources from the coverage report calculations using a regular expression.
|
25
49
|
(See [documentation](https://rspec-puppet.com/documentation/coverage/#excluded-resources) for an example.
|
26
|
-
* Added `have_unique_values_for_all` matcher to assert a specific resource parameter value is unique across
|
27
|
-
the entire catalogue.
|
50
|
+
* Added `have_unique_values_for_all` matcher to assert a specific resource parameter value is unique across
|
51
|
+
the entire catalogue.
|
28
52
|
(See [documentation](https://rspec-puppet.com/documentation/classes/#test-resource-parameter-values-for-uniqueness).)
|
29
|
-
* Added ability to customize module-layer Hiera configuration via new settings. See
|
53
|
+
* Added ability to customize module-layer Hiera configuration via new settings. See
|
30
54
|
[documentation](https://rspec-puppet.com/documentation/configuration/#disable_module_hiera) for details.
|
31
55
|
|
32
56
|
### Changed
|
33
57
|
* `RSpec::Puppet::Cache` now evicts least recently used entries when it reaches max size.
|
34
|
-
* `rspec-puppet`'s implementation of `match_manifests` will no longer look in `init.pp` for class
|
58
|
+
* `rspec-puppet`'s implementation of `match_manifests` will no longer look in `init.pp` for class
|
35
59
|
declarations if a manifest file exactly matching the class name exists.
|
36
|
-
|
60
|
+
|
37
61
|
### Fixed
|
38
62
|
* Resolved compatibility issues with Ruby 2.7.x and added Ruby 2.7.x to the test matrix.
|
39
63
|
* Resolved issues calculating coverage and reporting results when there are 0 tested resources.
|
@@ -546,13 +570,45 @@ Thanks to Adrien Thebo, Alex Harvey, Brian, Dan Bode, Dominic Cleal, Javier Pala
|
|
546
570
|
## 1.0.1 and earlier
|
547
571
|
For changelog of versions 1.0.1 and earlier, see http://rspec-puppet.com/changelog/
|
548
572
|
|
549
|
-
[2.x]: https://github.com/
|
550
|
-
[2.
|
551
|
-
[2.
|
552
|
-
[2.
|
553
|
-
[2.
|
554
|
-
[2.
|
555
|
-
[2.
|
556
|
-
[2.
|
557
|
-
[2.
|
558
|
-
[2.
|
573
|
+
[2.x]: https://github.com/puppetlabs/rspec-puppet/compare/v2.11.1...master
|
574
|
+
[2.11.1]: https://github.com/puppetlabs/rspec-puppet/compare/v2.11.0..v2.11.1
|
575
|
+
[2.11.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.10.0...v2.11.0
|
576
|
+
[2.10.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.9.0...v2.10.0
|
577
|
+
[2.9.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.8.0...v2.9.0
|
578
|
+
[2.8.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.10...v2.8.0
|
579
|
+
[2.7.10]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.9...v2.7.10
|
580
|
+
[2.7.9]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.8...v2.7.9
|
581
|
+
[2.7.8]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.7...v2.7.8
|
582
|
+
[2.7.7]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.6...v2.7.7
|
583
|
+
[2.7.6]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.5...v2.7.6
|
584
|
+
[2.7.5]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.4...v2.7.5
|
585
|
+
[2.7.4]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.3...v2.7.4
|
586
|
+
[2.7.3]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.2...v2.7.3
|
587
|
+
[2.7.2]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.1...v2.7.2
|
588
|
+
[2.7.1]: https://github.com/puppetlabs/rspec-puppet/compare/v2.7.0...v2.7.1
|
589
|
+
[2.7.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.15...v2.7.0
|
590
|
+
[2.6.15]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.14...v2.6.15
|
591
|
+
[2.6.14]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.13...v2.6.14
|
592
|
+
[2.6.13]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.12...v2.6.13
|
593
|
+
[2.6.12]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.11...v2.6.12
|
594
|
+
[2.6.11]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.10...v2.6.11
|
595
|
+
[2.6.10]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.9...v2.6.10
|
596
|
+
[2.6.9]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.8...v2.6.9
|
597
|
+
[2.6.8]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.7...v2.6.8
|
598
|
+
[2.6.7]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.6...v2.6.7
|
599
|
+
[2.6.6]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.5...v2.6.6
|
600
|
+
[2.6.5]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.4...v2.6.5
|
601
|
+
[2.6.4]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.3...v2.6.4
|
602
|
+
[2.6.3]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.2...v2.6.3
|
603
|
+
[2.6.2]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.1...v2.6.2
|
604
|
+
[2.6.1]: https://github.com/puppetlabs/rspec-puppet/compare/v2.6.0...v2.6.1
|
605
|
+
[2.6.0]: https://github.com/puppetlabs/rspec-puppet/compare/2.5.0...v2.6.0
|
606
|
+
[2.5.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.4.0...v2.5.0
|
607
|
+
[2.4.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.3.2...v2.4.0
|
608
|
+
[2.3.2]: https://github.com/puppetlabs/rspec-puppet/compare/v2.3.1...v2.3.2
|
609
|
+
[2.3.1]: https://github.com/puppetlabs/rspec-puppet/compare/v2.3.0...v2.3.1
|
610
|
+
[2.3.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.2.0...v2.3.0
|
611
|
+
[2.2.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.1.0...v2.2.0
|
612
|
+
[2.1.0]: https://github.com/puppetlabs/rspec-puppet/compare/v2.0.1...v2.1.0
|
613
|
+
[2.0.1]: https://github.com/puppetlabs/rspec-puppet/compare/v2.0.0...v2.0.1
|
614
|
+
[2.0.0]: https://github.com/puppetlabs/rspec-puppet/compare/v1.0.1...v2.0.0
|
data/README.md
CHANGED
@@ -230,6 +230,20 @@ In some circumstances (e.g. where your nodename/certname is not the same as
|
|
230
230
|
your FQDN), this behaviour is undesirable and can be disabled by changing this
|
231
231
|
setting to `false`.
|
232
232
|
|
233
|
+
#### facter\_implementation
|
234
|
+
Type | Default | Puppet Version(s)
|
235
|
+
------- | -------- | -----------------
|
236
|
+
String | `facter` | 6.25+, 7.12+
|
237
|
+
|
238
|
+
Configures rspec-puppet to use a specific Facter implementation for running
|
239
|
+
unit tests. If the `rspec` implementation is set and Puppet does not support
|
240
|
+
it, rspec-puppet will warn and fall back to the `facter` implementation.
|
241
|
+
Setting an unsupported option will make rspec-puppet raise an error.
|
242
|
+
|
243
|
+
* `facter` - Use the default implementation, honoring the Facter version specified in the Gemfile
|
244
|
+
* `rspec` - Use a custom hash-based implementation of Facter defined in
|
245
|
+
rspec-puppet (this provides a considerable gain in speed if tests are run with Facter 4)
|
246
|
+
|
233
247
|
## Naming conventions
|
234
248
|
|
235
249
|
For clarity and consistency, I recommend that you use the following directory
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'rspec-puppet/facter_impl'
|
2
|
+
|
1
3
|
module RSpec::Puppet
|
2
4
|
module Adapters
|
3
5
|
|
@@ -108,6 +110,21 @@ module RSpec::Puppet
|
|
108
110
|
end
|
109
111
|
|
110
112
|
class Adapter40 < Base
|
113
|
+
#
|
114
|
+
# @api private
|
115
|
+
#
|
116
|
+
# Set the FacterImpl constant to the given Facter implementation or noop
|
117
|
+
# if the constant is already set. If a proc is given, it will only be
|
118
|
+
# called if FacterImpl is not defined.
|
119
|
+
#
|
120
|
+
# @param impl [Object, Proc] An object or a proc that implements the Facter API
|
121
|
+
def set_facter_impl(impl)
|
122
|
+
return if defined?(FacterImpl)
|
123
|
+
|
124
|
+
impl = impl.call if impl.is_a?(Proc)
|
125
|
+
Object.send(:const_set, :FacterImpl, impl)
|
126
|
+
end
|
127
|
+
|
111
128
|
def setup_puppet(example_group)
|
112
129
|
super
|
113
130
|
|
@@ -139,7 +156,8 @@ module RSpec::Puppet
|
|
139
156
|
Puppet.push_context(
|
140
157
|
{
|
141
158
|
:environments => loader,
|
142
|
-
:current_environment => env
|
159
|
+
:current_environment => env,
|
160
|
+
:loaders => (Puppet::Pops::Loaders.new(env) if Gem::Version.new(Puppet.version) >= Gem::Version.new('6.0.0')),
|
143
161
|
},
|
144
162
|
"Setup rspec-puppet environments"
|
145
163
|
)
|
@@ -185,6 +203,12 @@ module RSpec::Puppet
|
|
185
203
|
end
|
186
204
|
|
187
205
|
class Adapter4X < Adapter40
|
206
|
+
def setup_puppet(example_group)
|
207
|
+
super
|
208
|
+
|
209
|
+
set_facter_impl(Facter)
|
210
|
+
end
|
211
|
+
|
188
212
|
def settings_map
|
189
213
|
super.concat([
|
190
214
|
[:trusted_server_facts, :trusted_server_facts]
|
@@ -193,6 +217,48 @@ module RSpec::Puppet
|
|
193
217
|
end
|
194
218
|
|
195
219
|
class Adapter6X < Adapter40
|
220
|
+
#
|
221
|
+
# @api private
|
222
|
+
#
|
223
|
+
# Check to see if Facter runtime implementations are supported in the
|
224
|
+
# current Puppet version
|
225
|
+
#
|
226
|
+
# @return [Boolean] true if runtime implementations are supported
|
227
|
+
def supports_facter_runtime?
|
228
|
+
unless defined?(@supports_facter_runtime)
|
229
|
+
begin
|
230
|
+
Puppet.runtime[:facter]
|
231
|
+
@supports_facter_runtime = true
|
232
|
+
rescue
|
233
|
+
@supports_facter_runtime = false
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
@supports_facter_runtime
|
238
|
+
end
|
239
|
+
|
240
|
+
def setup_puppet(example_group)
|
241
|
+
case RSpec.configuration.facter_implementation.to_sym
|
242
|
+
when :rspec
|
243
|
+
if supports_facter_runtime?
|
244
|
+
# Lazily instantiate FacterTestImpl here to optimize memory
|
245
|
+
# allocation, as the proc will only be called if FacterImpl is unset
|
246
|
+
set_facter_impl(proc { RSpec::Puppet::FacterTestImpl.new })
|
247
|
+
Puppet.runtime[:facter] = FacterImpl
|
248
|
+
else
|
249
|
+
warn "Facter runtime implementations are not supported in Puppet #{Puppet.version}, continuing with facter_implementation 'facter'"
|
250
|
+
RSpec.configuration.facter_implementation = :facter
|
251
|
+
set_facter_impl(Facter)
|
252
|
+
end
|
253
|
+
when :facter
|
254
|
+
set_facter_impl(Facter)
|
255
|
+
else
|
256
|
+
raise "Unsupported facter_implementation '#{RSpec.configuration.facter_implementation}'"
|
257
|
+
end
|
258
|
+
|
259
|
+
super
|
260
|
+
end
|
261
|
+
|
196
262
|
def settings_map
|
197
263
|
super.concat([
|
198
264
|
[:basemodulepath, :basemodulepath],
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module RSpec::Puppet
|
2
|
+
|
3
|
+
# Implements a simple hash-based version of Facter to be used in module tests
|
4
|
+
# that use rspec-puppet.
|
5
|
+
class FacterTestImpl
|
6
|
+
def initialize
|
7
|
+
@facts = {}
|
8
|
+
end
|
9
|
+
|
10
|
+
def value(fact_name)
|
11
|
+
@facts[fact_name.to_s]
|
12
|
+
end
|
13
|
+
|
14
|
+
def clear
|
15
|
+
@facts.clear
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_hash
|
19
|
+
@facts
|
20
|
+
end
|
21
|
+
|
22
|
+
def add(name, options = {}, &block)
|
23
|
+
raise 'Facter.add expects a block' unless block_given?
|
24
|
+
@facts[name.to_s] = instance_eval(&block)
|
25
|
+
end
|
26
|
+
|
27
|
+
# noop methods
|
28
|
+
def debugging(arg); end
|
29
|
+
|
30
|
+
def reset; end
|
31
|
+
|
32
|
+
def search(*paths); end
|
33
|
+
|
34
|
+
def setup_logging; end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def setcode(string = nil, &block)
|
39
|
+
if block_given?
|
40
|
+
value = block.call
|
41
|
+
else
|
42
|
+
value = string
|
43
|
+
end
|
44
|
+
|
45
|
+
value
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
@@ -7,13 +7,15 @@ module RSpec::Puppet
|
|
7
7
|
'Stage[main]',
|
8
8
|
].freeze
|
9
9
|
|
10
|
+
attr_reader :resource_type
|
11
|
+
|
10
12
|
def initialize(type, count, *method)
|
11
13
|
if type.nil?
|
12
14
|
@type = method[0].to_s.gsub(/^have_(.+)_resource_count$/, '\1')
|
13
15
|
else
|
14
16
|
@type = type
|
15
17
|
end
|
16
|
-
@
|
18
|
+
@resource_type = referenced_type(@type)
|
17
19
|
@expected_number = count.to_i
|
18
20
|
end
|
19
21
|
|
@@ -30,7 +32,7 @@ module RSpec::Puppet
|
|
30
32
|
end
|
31
33
|
else
|
32
34
|
resources.count do |res|
|
33
|
-
res.type == @
|
35
|
+
res.type == @resource_type
|
34
36
|
end
|
35
37
|
end
|
36
38
|
|
@@ -45,7 +47,7 @@ module RSpec::Puppet
|
|
45
47
|
desc << "#{@expected_number == 1 ? "class" : "classes" }"
|
46
48
|
else
|
47
49
|
unless @type == "resource"
|
48
|
-
desc << "#{@
|
50
|
+
desc << "#{@resource_type}"
|
49
51
|
end
|
50
52
|
desc << "#{@expected_number == 1 ? "resource" : "resources" }"
|
51
53
|
end
|
@@ -307,14 +307,17 @@ module RSpec::Puppet
|
|
307
307
|
end
|
308
308
|
end
|
309
309
|
|
310
|
-
# Add
|
311
|
-
if
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
310
|
+
# Add auto* (autorequire etc) if any
|
311
|
+
if [:before, :notify, :require, :subscribe].include?(type)
|
312
|
+
func = "eachauto#{type}".to_sym
|
313
|
+
if resource.resource_type.respond_to?(func)
|
314
|
+
resource.resource_type.send(func) do |t, b|
|
315
|
+
Array(resource.to_ral.instance_eval(&b)).each do |dep|
|
316
|
+
res = "#{t.to_s.capitalize}[#{dep}]"
|
317
|
+
if r = relationship_refs(res, type, visited)
|
318
|
+
results << res
|
319
|
+
results << r
|
320
|
+
end
|
318
321
|
end
|
319
322
|
end
|
320
323
|
end
|
@@ -4,7 +4,7 @@ module RSpec::Puppet
|
|
4
4
|
|
5
5
|
matcher :include_class do |expected_class|
|
6
6
|
match do |catalogue|
|
7
|
-
RSpec.deprecate(
|
7
|
+
RSpec.deprecate('include_class()', :replacement => 'contain_class()')
|
8
8
|
catalogue.call.classes.include?(expected_class)
|
9
9
|
end
|
10
10
|
|
@@ -29,7 +29,11 @@ module RSpec::Puppet
|
|
29
29
|
# @param other [#unwrap, Object] value to compare to
|
30
30
|
def == other
|
31
31
|
if other.respond_to? :unwrap
|
32
|
-
|
32
|
+
if unwrap.kind_of?(Regexp)
|
33
|
+
return unwrap =~ other.unwrap
|
34
|
+
else
|
35
|
+
return unwrap == other.unwrap
|
36
|
+
end
|
33
37
|
else
|
34
38
|
super
|
35
39
|
end
|
data/lib/rspec-puppet/support.rb
CHANGED
@@ -337,7 +337,7 @@ module RSpec::Puppet
|
|
337
337
|
{"servername" => "fqdn",
|
338
338
|
"serverip" => "ipaddress"
|
339
339
|
}.each do |var, fact|
|
340
|
-
if value =
|
340
|
+
if value = FacterImpl.value(fact)
|
341
341
|
server_facts[var] = value
|
342
342
|
else
|
343
343
|
warn "Could not retrieve fact #{fact}"
|
@@ -345,8 +345,8 @@ module RSpec::Puppet
|
|
345
345
|
end
|
346
346
|
|
347
347
|
if server_facts["servername"].nil?
|
348
|
-
host =
|
349
|
-
if domain =
|
348
|
+
host = FacterImpl.value(:hostname)
|
349
|
+
if domain = FacterImpl.value(:domain)
|
350
350
|
server_facts["servername"] = [host, domain].join(".")
|
351
351
|
else
|
352
352
|
server_facts["servername"] = host
|
@@ -392,7 +392,7 @@ module RSpec::Puppet
|
|
392
392
|
|
393
393
|
# Enable app_management by default for Puppet versions that support it
|
394
394
|
if Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0 && Puppet.version.to_i < 5
|
395
|
-
Puppet[:app_management] = true
|
395
|
+
Puppet[:app_management] = ENV.include?('PUPPET_NOAPP_MANAGMENT') ? false : true
|
396
396
|
end
|
397
397
|
|
398
398
|
adapter.modulepath.map do |d|
|
@@ -478,14 +478,14 @@ module RSpec::Puppet
|
|
478
478
|
|
479
479
|
def stub_facts!(facts)
|
480
480
|
Puppet.settings[:autosign] = false if Puppet.settings.include? :autosign
|
481
|
-
|
482
|
-
facts.each { |k, v|
|
481
|
+
FacterImpl.clear
|
482
|
+
facts.each { |k, v| FacterImpl.add(k, :weight => 999) { setcode { v } } }
|
483
483
|
end
|
484
484
|
|
485
485
|
def build_catalog(*args)
|
486
486
|
@@cache.get(*args) do |*args|
|
487
487
|
if args.length == 1 && args.first.is_a?(Hash)
|
488
|
-
build_catalog_without_cache_v2(args.first)
|
488
|
+
build_catalog_without_cache_v2(**args.first)
|
489
489
|
else
|
490
490
|
build_catalog_without_cache(*args)
|
491
491
|
end
|
data/lib/rspec-puppet.rb
CHANGED
@@ -43,6 +43,7 @@ RSpec.configure do |c|
|
|
43
43
|
c.add_setting :default_node_params, :default => {}
|
44
44
|
c.add_setting :default_trusted_facts, :default => {}
|
45
45
|
c.add_setting :default_trusted_external_data, :default => {}
|
46
|
+
c.add_setting :facter_implementation, :default => :facter
|
46
47
|
c.add_setting :hiera_config, :default => Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
47
48
|
c.add_setting :parser, :default => 'current'
|
48
49
|
c.add_setting :trusted_node_data, :default => false
|
metadata
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Sharpe
|
8
|
-
|
8
|
+
- Puppet, Inc.
|
9
|
+
- Community Contributors
|
10
|
+
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
11
|
-
date:
|
13
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
12
14
|
dependencies:
|
13
15
|
- !ruby/object:Gem::Dependency
|
14
16
|
name: rspec
|
@@ -25,7 +27,9 @@ dependencies:
|
|
25
27
|
- !ruby/object:Gem::Version
|
26
28
|
version: '0'
|
27
29
|
description: RSpec tests for your Puppet manifests
|
28
|
-
email:
|
30
|
+
email:
|
31
|
+
- tim@sharpe.id.au
|
32
|
+
- modules-team@puppet.com
|
29
33
|
executables:
|
30
34
|
- rspec-puppet-init
|
31
35
|
extensions: []
|
@@ -49,6 +53,7 @@ files:
|
|
49
53
|
- lib/rspec-puppet/example/provider_example_group.rb
|
50
54
|
- lib/rspec-puppet/example/type_alias_example_group.rb
|
51
55
|
- lib/rspec-puppet/example/type_example_group.rb
|
56
|
+
- lib/rspec-puppet/facter_impl.rb
|
52
57
|
- lib/rspec-puppet/matchers.rb
|
53
58
|
- lib/rspec-puppet/matchers/allow_value.rb
|
54
59
|
- lib/rspec-puppet/matchers/compile.rb
|
@@ -72,11 +77,11 @@ files:
|
|
72
77
|
- lib/rspec-puppet/spec_helper.rb
|
73
78
|
- lib/rspec-puppet/support.rb
|
74
79
|
- lib/rspec-puppet/tasks/release_test.rb
|
75
|
-
homepage: https://github.com/
|
80
|
+
homepage: https://github.com/puppetlabs/rspec-puppet/
|
76
81
|
licenses:
|
77
82
|
- MIT
|
78
83
|
metadata: {}
|
79
|
-
post_install_message:
|
84
|
+
post_install_message:
|
80
85
|
rdoc_options: []
|
81
86
|
require_paths:
|
82
87
|
- lib
|
@@ -91,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
96
|
- !ruby/object:Gem::Version
|
92
97
|
version: '0'
|
93
98
|
requirements: []
|
94
|
-
rubygems_version: 3.
|
95
|
-
signing_key:
|
99
|
+
rubygems_version: 3.1.6
|
100
|
+
signing_key:
|
96
101
|
specification_version: 4
|
97
102
|
summary: RSpec tests for your Puppet manifests
|
98
103
|
test_files: []
|