rspec-puppet 2.8.0 → 2.9.0

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: 375cf91b75c36ee1bc0bbade72608205a7b85fce94a49d0fcfafb02fa6f8eddc
4
- data.tar.gz: 732ce59e27a5fd9d15052262d21b2de6df85b090fb56152aca88da4480133ac1
3
+ metadata.gz: 420f47c99ab3190a3e97c2b172e694694a5d997a56e70366bd168c8338c21fb9
4
+ data.tar.gz: 21f2d247e5169ba70e490d6b9c66fc8542a1c3c1cd99d1e5895a1322a9cfac1b
5
5
  SHA512:
6
- metadata.gz: 3f1b0bb5c052df4ff70981384ad81bdc2e75ec1f23f9a890f101a933a4f7f50d569acef001524c7c3a9f37f0cfffd2eeaf0a26a7d67f8a3abd80b7147005e758
7
- data.tar.gz: 65f0fbe718948c13b1866bb8d71c6b03fe741927ed86e97d6eeefb39526e98671e3ac5ae98e14e939654988fa8c272b3e72f66c5b61e9c6321fac11d5b66e276
6
+ metadata.gz: a5b2ef185120131a07fc6e063a7ee2d2cb191db8a765bb5cdda1fce92081547c4d0aea83b386faaf1d20e8051d51d84ba05facc5f9deb74f3aecdeea67798b86
7
+ data.tar.gz: 4714dac2b13e5a4eb44a8c965a61e08cc7e2ded172271ea61f85bfae22d43f51dde5d609f0a1d3515844fb5924b48ad8441fbb071eef267c0af6f886c0e21c9c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
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.9.0]
6
+
7
+ ### Added
8
+ * Allow users to disable app_management for Puppet 4
9
+ * Added support for regexp arguments to Sensitive
10
+ * Handle all auto*, not just autorequire
11
+ * Set up loaders so that 4.x functions resolve properly
12
+
5
13
  ## [2.8.0]
6
14
 
7
15
  ### Breaking Changes
@@ -546,7 +554,36 @@ Thanks to Adrien Thebo, Alex Harvey, Brian, Dan Bode, Dominic Cleal, Javier Pala
546
554
  ## 1.0.1 and earlier
547
555
  For changelog of versions 1.0.1 and earlier, see http://rspec-puppet.com/changelog/
548
556
 
549
- [2.x]: https://github.com/rodjek/rspec-puppet/compare/v2.5.0...master
557
+ [2.x]: https://github.com/rodjek/rspec-puppet/compare/v2.9.0...master
558
+ [2.9.0]: https://github.com/rodjek/rspec-puppet/compare/v2.8.0...v2.9.0
559
+ [2.8.0]: https://github.com/rodjek/rspec-puppet/compare/v2.7.10...v2.8.0
560
+ [2.7.10]: https://github.com/rodjek/rspec-puppet/compare/v2.7.9...v2.7.10
561
+ [2.7.9]: https://github.com/rodjek/rspec-puppet/compare/v2.7.8...v2.7.9
562
+ [2.7.8]: https://github.com/rodjek/rspec-puppet/compare/v2.7.7...v2.7.8
563
+ [2.7.7]: https://github.com/rodjek/rspec-puppet/compare/v2.7.6...v2.7.7
564
+ [2.7.6]: https://github.com/rodjek/rspec-puppet/compare/v2.7.5...v2.7.6
565
+ [2.7.5]: https://github.com/rodjek/rspec-puppet/compare/v2.7.4...v2.7.5
566
+ [2.7.4]: https://github.com/rodjek/rspec-puppet/compare/v2.7.3...v2.7.4
567
+ [2.7.3]: https://github.com/rodjek/rspec-puppet/compare/v2.7.2...v2.7.3
568
+ [2.7.2]: https://github.com/rodjek/rspec-puppet/compare/v2.7.1...v2.7.2
569
+ [2.7.1]: https://github.com/rodjek/rspec-puppet/compare/v2.7.0...v2.7.1
570
+ [2.7.0]: https://github.com/rodjek/rspec-puppet/compare/v2.6.15...v2.7.0
571
+ [2.6.15]: https://github.com/rodjek/rspec-puppet/compare/v2.6.14...v2.6.15
572
+ [2.6.14]: https://github.com/rodjek/rspec-puppet/compare/v2.6.13...v2.6.14
573
+ [2.6.13]: https://github.com/rodjek/rspec-puppet/compare/v2.6.12...v2.6.13
574
+ [2.6.12]: https://github.com/rodjek/rspec-puppet/compare/v2.6.11...v2.6.12
575
+ [2.6.11]: https://github.com/rodjek/rspec-puppet/compare/v2.6.10...v2.6.11
576
+ [2.6.10]: https://github.com/rodjek/rspec-puppet/compare/v2.6.9...v2.6.10
577
+ [2.6.9]: https://github.com/rodjek/rspec-puppet/compare/v2.6.8...v2.6.9
578
+ [2.6.8]: https://github.com/rodjek/rspec-puppet/compare/v2.6.7...v2.6.8
579
+ [2.6.7]: https://github.com/rodjek/rspec-puppet/compare/v2.6.6...v2.6.7
580
+ [2.6.6]: https://github.com/rodjek/rspec-puppet/compare/v2.6.5...v2.6.6
581
+ [2.6.5]: https://github.com/rodjek/rspec-puppet/compare/v2.6.4...v2.6.5
582
+ [2.6.4]: https://github.com/rodjek/rspec-puppet/compare/v2.6.3...v2.6.4
583
+ [2.6.3]: https://github.com/rodjek/rspec-puppet/compare/v2.6.2...v2.6.3
584
+ [2.6.2]: https://github.com/rodjek/rspec-puppet/compare/v2.6.1...v2.6.2
585
+ [2.6.1]: https://github.com/rodjek/rspec-puppet/compare/v2.6.0...v2.6.1
586
+ [2.6.0]: https://github.com/rodjek/rspec-puppet/compare/2.5.0...v2.6.0
550
587
  [2.5.0]: https://github.com/rodjek/rspec-puppet/compare/v2.4.0...v2.5.0
551
588
  [2.4.0]: https://github.com/rodjek/rspec-puppet/compare/v2.3.2...v2.4.0
552
589
  [2.3.2]: https://github.com/rodjek/rspec-puppet/compare/v2.3.1...v2.3.2
@@ -139,7 +139,8 @@ module RSpec::Puppet
139
139
  Puppet.push_context(
140
140
  {
141
141
  :environments => loader,
142
- :current_environment => env
142
+ :current_environment => env,
143
+ :loaders => (Puppet::Pops::Loaders.new(env) if Gem::Version.new(Puppet.version) >= Gem::Version.new('6.0.0')),
143
144
  },
144
145
  "Setup rspec-puppet environments"
145
146
  )
@@ -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
- @referenced_type = referenced_type(@type)
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 == @referenced_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 << "#{@referenced_type}"
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 autorequires if any
311
- if type == :require and resource.resource_type.respond_to? :eachautorequire
312
- resource.resource_type.eachautorequire do |t, b|
313
- Array(resource.to_ral.instance_eval(&b)).each do |dep|
314
- res = "#{t.to_s.capitalize}[#{dep}]"
315
- if r = relationship_refs(res, type, visited)
316
- results << res
317
- results << r
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(:include_class, :replacement => :contain_class)
7
+ RSpec.deprecate('include_class()', :replacement => 'contain_class()')
8
8
  catalogue.call.classes.include?(expected_class)
9
9
  end
10
10
 
@@ -52,9 +52,6 @@ module RSpec::Puppet
52
52
  self
53
53
  end
54
54
 
55
- #def with_autorequires(autorequires))
56
- #end
57
-
58
55
  #
59
56
  # this is the method that drives all of the validation
60
57
  #
@@ -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
- return unwrap == other.unwrap
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
@@ -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|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Sharpe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-05 00:00:00.000000000 Z
11
+ date: 2021-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  - !ruby/object:Gem::Version
92
92
  version: '0'
93
93
  requirements: []
94
- rubygems_version: 3.0.8
94
+ rubygems_version: 3.2.5
95
95
  signing_key:
96
96
  specification_version: 4
97
97
  summary: RSpec tests for your Puppet manifests