rspec-puppet 2.11.0 → 4.0.0
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 +4 -4
- data/CHANGELOG.md +154 -469
- data/README.md +71 -168
- data/bin/rspec-puppet-init +4 -3
- data/lib/rspec-puppet/adapters.rb +84 -230
- data/lib/rspec-puppet/cache.rb +3 -2
- data/lib/rspec-puppet/consts.rb +16 -14
- data/lib/rspec-puppet/coverage.rb +37 -42
- data/lib/rspec-puppet/errors.rb +6 -6
- data/lib/rspec-puppet/example/class_example_group.rb +3 -1
- data/lib/rspec-puppet/example/define_example_group.rb +3 -1
- data/lib/rspec-puppet/example/function_example_group.rb +42 -57
- data/lib/rspec-puppet/example/host_example_group.rb +3 -1
- data/lib/rspec-puppet/example/provider_example_group.rb +2 -0
- data/lib/rspec-puppet/example/type_alias_example_group.rb +4 -2
- data/lib/rspec-puppet/example/type_example_group.rb +3 -1
- data/lib/rspec-puppet/example.rb +6 -9
- data/lib/rspec-puppet/facter_impl.rb +11 -10
- data/lib/rspec-puppet/matchers/allow_value.rb +10 -10
- data/lib/rspec-puppet/matchers/compile.rb +54 -61
- data/lib/rspec-puppet/matchers/count_generic.rb +18 -18
- data/lib/rspec-puppet/matchers/create_generic.rb +69 -79
- data/lib/rspec-puppet/matchers/dynamic_matchers.rb +15 -4
- data/lib/rspec-puppet/matchers/include_class.rb +5 -4
- data/lib/rspec-puppet/matchers/parameter_matcher.rb +11 -12
- data/lib/rspec-puppet/matchers/raise_error.rb +5 -1
- data/lib/rspec-puppet/matchers/run.rb +41 -42
- data/lib/rspec-puppet/matchers/type_matchers.rb +37 -48
- data/lib/rspec-puppet/matchers.rb +2 -0
- data/lib/rspec-puppet/monkey_patches/win32/registry.rb +7 -5
- data/lib/rspec-puppet/monkey_patches/win32/taskscheduler.rb +3 -1
- data/lib/rspec-puppet/monkey_patches/windows/taskschedulerconstants.rb +208 -205
- data/lib/rspec-puppet/monkey_patches.rb +80 -93
- data/lib/rspec-puppet/rake_task.rb +6 -4
- data/lib/rspec-puppet/raw_string.rb +2 -0
- data/lib/rspec-puppet/sensitive.rb +31 -39
- data/lib/rspec-puppet/setup.rb +45 -56
- data/lib/rspec-puppet/spec_helper.rb +2 -3
- data/lib/rspec-puppet/support.rb +129 -177
- data/lib/rspec-puppet/tasks/release_test.rb +8 -5
- data/lib/rspec-puppet/version.rb +5 -0
- data/lib/rspec-puppet.rb +37 -61
- metadata +18 -15
- data/lib/rspec-puppet/example/application_example_group.rb +0 -19
data/lib/rspec-puppet.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'puppet'
|
|
2
4
|
require 'rspec'
|
|
3
5
|
require 'fileutils'
|
|
@@ -16,7 +18,7 @@ rescue LoadError
|
|
|
16
18
|
end
|
|
17
19
|
|
|
18
20
|
RSpec.configure do |c|
|
|
19
|
-
c.add_setting :enable_pathname_stubbing, :
|
|
21
|
+
c.add_setting :enable_pathname_stubbing, default: false
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
module RSpec::Puppet
|
|
@@ -32,50 +34,32 @@ end
|
|
|
32
34
|
require 'rspec-puppet/monkey_patches'
|
|
33
35
|
|
|
34
36
|
RSpec.configure do |c|
|
|
35
|
-
c.add_setting :environmentpath, :
|
|
36
|
-
c.add_setting :module_path, :
|
|
37
|
-
c.add_setting :
|
|
38
|
-
c.add_setting :
|
|
39
|
-
c.add_setting :
|
|
40
|
-
c.add_setting :
|
|
41
|
-
c.add_setting :
|
|
42
|
-
c.add_setting :
|
|
43
|
-
c.add_setting :
|
|
44
|
-
c.add_setting :
|
|
45
|
-
c.add_setting :
|
|
46
|
-
c.add_setting :
|
|
47
|
-
c.add_setting :
|
|
48
|
-
c.add_setting :
|
|
49
|
-
c.add_setting :
|
|
50
|
-
c.add_setting :ordering, :default => 'title-hash'
|
|
51
|
-
c.add_setting :stringify_facts, :default => true
|
|
52
|
-
c.add_setting :strict_variables, :default => false
|
|
53
|
-
c.add_setting :setup_fixtures, :default => true
|
|
54
|
-
c.add_setting :derive_node_facts_from_nodename, :default => true
|
|
37
|
+
c.add_setting :environmentpath, default: Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
|
38
|
+
c.add_setting :module_path, default: nil
|
|
39
|
+
c.add_setting :manifest, default: nil
|
|
40
|
+
c.add_setting :config, default: nil
|
|
41
|
+
c.add_setting :confdir, default: Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
|
42
|
+
c.add_setting :default_facts, default: {}
|
|
43
|
+
c.add_setting :default_node_params, default: {}
|
|
44
|
+
c.add_setting :default_trusted_facts, default: {}
|
|
45
|
+
c.add_setting :default_trusted_external_data, default: {}
|
|
46
|
+
c.add_setting :facter_implementation, default: :facter
|
|
47
|
+
c.add_setting :hiera_config, default: Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
|
48
|
+
c.add_setting :stringify_facts, default: true
|
|
49
|
+
c.add_setting :strict_variables, default: false
|
|
50
|
+
c.add_setting :setup_fixtures, default: true
|
|
51
|
+
c.add_setting :derive_node_facts_from_nodename, default: true
|
|
55
52
|
c.add_setting :adapter
|
|
56
|
-
c.add_setting :platform, :
|
|
57
|
-
c.add_setting :vendormoduledir, :
|
|
58
|
-
c.add_setting :basemodulepath, :
|
|
59
|
-
c.add_setting :disable_module_hiera, :
|
|
60
|
-
c.add_setting :fixture_hiera_configs, :
|
|
61
|
-
c.add_setting :use_fixture_spec_hiera, :
|
|
62
|
-
c.add_setting :fallback_to_default_hiera, :
|
|
63
|
-
|
|
64
|
-
c.instance_eval do
|
|
65
|
-
def trusted_server_facts
|
|
66
|
-
@trusted_server_facts.nil? ? false : @trusted_server_facts
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def trusted_server_facts=(value)
|
|
70
|
-
@trusted_server_facts = value
|
|
71
|
-
adapter.setup_puppet(RSpec::Puppet.current_example) unless adapter.nil?
|
|
72
|
-
end
|
|
73
|
-
end
|
|
53
|
+
c.add_setting :platform, default: Puppet::Util::Platform.actual_platform
|
|
54
|
+
c.add_setting :vendormoduledir, default: Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
|
55
|
+
c.add_setting :basemodulepath, default: Puppet::Util::Platform.actually_windows? ? 'c:/nul/' : '/dev/null'
|
|
56
|
+
c.add_setting :disable_module_hiera, default: false
|
|
57
|
+
c.add_setting :fixture_hiera_configs, default: {}
|
|
58
|
+
c.add_setting :use_fixture_spec_hiera, default: false
|
|
59
|
+
c.add_setting :fallback_to_default_hiera, default: true
|
|
74
60
|
|
|
75
61
|
c.before(:all) do
|
|
76
|
-
if RSpec.configuration.setup_fixtures?
|
|
77
|
-
RSpec::Puppet::Setup.safe_setup_directories(nil, false)
|
|
78
|
-
end
|
|
62
|
+
RSpec::Puppet::Setup.safe_setup_directories(nil, false) if RSpec.configuration.setup_fixtures?
|
|
79
63
|
end
|
|
80
64
|
|
|
81
65
|
if defined?(Puppet::Test::TestHelper)
|
|
@@ -86,33 +70,25 @@ RSpec.configure do |c|
|
|
|
86
70
|
end
|
|
87
71
|
|
|
88
72
|
c.before :all do
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
rescue
|
|
92
|
-
end
|
|
73
|
+
Puppet::Test::TestHelper.before_all_tests
|
|
74
|
+
rescue StandardError
|
|
93
75
|
end
|
|
94
76
|
|
|
95
77
|
c.after :all do
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
rescue
|
|
99
|
-
end
|
|
78
|
+
Puppet::Test::TestHelper.after_all_tests
|
|
79
|
+
rescue StandardError
|
|
100
80
|
end
|
|
101
81
|
|
|
102
82
|
c.before :each do
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
rescue
|
|
108
|
-
end
|
|
83
|
+
Puppet::Test::TestHelper.before_each_test
|
|
84
|
+
rescue Puppet::Context::DuplicateRollbackMarkError
|
|
85
|
+
Puppet::Test::TestHelper.send(:initialize_settings_before_each)
|
|
86
|
+
rescue StandardError
|
|
109
87
|
end
|
|
110
88
|
|
|
111
89
|
c.after :each do
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
rescue
|
|
115
|
-
end
|
|
90
|
+
Puppet::Test::TestHelper.after_each_test
|
|
91
|
+
rescue StandardError
|
|
116
92
|
end
|
|
117
93
|
end
|
|
118
94
|
|
|
@@ -127,7 +103,7 @@ RSpec.configure do |c|
|
|
|
127
103
|
c.before :each do |example|
|
|
128
104
|
if RSpec::Puppet.rspec_puppet_example?
|
|
129
105
|
Puppet::Util::Platform.pretend_to_be RSpec.configuration.platform
|
|
130
|
-
stub_file_consts(example) if
|
|
106
|
+
stub_file_consts(example) if respond_to?(:stub_file_consts)
|
|
131
107
|
|
|
132
108
|
if defined?(Selinux)
|
|
133
109
|
if respond_to?(:allow)
|
metadata
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rspec-puppet
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Sharpe
|
|
8
8
|
- Puppet, Inc.
|
|
9
9
|
- Community Contributors
|
|
10
|
-
autorequire:
|
|
10
|
+
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2023-10-09 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rspec
|
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
|
18
18
|
requirements:
|
|
19
|
-
- - "
|
|
19
|
+
- - "~>"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: '0'
|
|
21
|
+
version: '3.0'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
25
|
requirements:
|
|
26
|
-
- - "
|
|
26
|
+
- - "~>"
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: '0'
|
|
29
|
-
description:
|
|
28
|
+
version: '3.0'
|
|
29
|
+
description: |2
|
|
30
|
+
RSpec tests for your Puppet manifests.
|
|
31
|
+
Note: Support for this gem has been moved under a new namespace and as such any future updates from
|
|
32
|
+
the Puppet team will be released as `puppetlabs-rspec-puppet`.
|
|
30
33
|
email:
|
|
31
34
|
- tim@sharpe.id.au
|
|
32
35
|
- modules-team@puppet.com
|
|
@@ -45,7 +48,6 @@ files:
|
|
|
45
48
|
- lib/rspec-puppet/coverage.rb
|
|
46
49
|
- lib/rspec-puppet/errors.rb
|
|
47
50
|
- lib/rspec-puppet/example.rb
|
|
48
|
-
- lib/rspec-puppet/example/application_example_group.rb
|
|
49
51
|
- lib/rspec-puppet/example/class_example_group.rb
|
|
50
52
|
- lib/rspec-puppet/example/define_example_group.rb
|
|
51
53
|
- lib/rspec-puppet/example/function_example_group.rb
|
|
@@ -77,11 +79,13 @@ files:
|
|
|
77
79
|
- lib/rspec-puppet/spec_helper.rb
|
|
78
80
|
- lib/rspec-puppet/support.rb
|
|
79
81
|
- lib/rspec-puppet/tasks/release_test.rb
|
|
82
|
+
- lib/rspec-puppet/version.rb
|
|
80
83
|
homepage: https://github.com/puppetlabs/rspec-puppet/
|
|
81
84
|
licenses:
|
|
82
85
|
- MIT
|
|
83
|
-
metadata:
|
|
84
|
-
|
|
86
|
+
metadata:
|
|
87
|
+
rubygems_mfa_required: 'true'
|
|
88
|
+
post_install_message:
|
|
85
89
|
rdoc_options: []
|
|
86
90
|
require_paths:
|
|
87
91
|
- lib
|
|
@@ -89,16 +93,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
89
93
|
requirements:
|
|
90
94
|
- - ">="
|
|
91
95
|
- !ruby/object:Gem::Version
|
|
92
|
-
version:
|
|
96
|
+
version: 2.7.0
|
|
93
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
98
|
requirements:
|
|
95
99
|
- - ">="
|
|
96
100
|
- !ruby/object:Gem::Version
|
|
97
101
|
version: '0'
|
|
98
102
|
requirements: []
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
signing_key:
|
|
103
|
+
rubygems_version: 3.1.6
|
|
104
|
+
signing_key:
|
|
102
105
|
specification_version: 4
|
|
103
106
|
summary: RSpec tests for your Puppet manifests
|
|
104
107
|
test_files: []
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module RSpec::Puppet
|
|
2
|
-
# This module provides support for the application type
|
|
3
|
-
module ApplicationExampleGroup
|
|
4
|
-
include RSpec::Puppet::ManifestMatchers
|
|
5
|
-
include RSpec::Puppet::Support
|
|
6
|
-
|
|
7
|
-
def catalogue
|
|
8
|
-
@catalogue ||= load_catalogue(:application)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
def exported_resources
|
|
12
|
-
lambda { load_catalogue(:application, true) }
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
def rspec_puppet_cleanup
|
|
16
|
-
@catalogue = nil
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
end
|