puppet-unit-tests 0.1.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: db3e14f98dbe5bcd033b2f0967db022a10d59a4df551d1b2fd196e82c77c4592
4
+ data.tar.gz: 420e1254f3b4b1254bdf3bf2a40c21e6ff8407e29c2ee2a0b0bff0ca3b664aed
5
+ SHA512:
6
+ metadata.gz: c13c1ffa6ea8d3b68851d82eb77bc5048f6bd332ccb22baf05ee935f50d002b7b7f6135b96fbd6b77bb79324e0a64c3283c06ad2210fdfa6d81dfe2549f000df
7
+ data.tar.gz: fd1b2728f3db290f0a5c55b41398b749b3b0702102e277c6733d603000c595f1322d8188c58b0cd0bc9f3120e136f86464f117e019798a5c9edfbbdbe01bc464
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2025-09-11
4
+
5
+ - Initial release
@@ -0,0 +1,132 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ [INSERT CONTACT METHOD].
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [homepage]: https://www.contributor-covenant.org
129
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130
+ [Mozilla CoC]: https://github.com/mozilla/diversity
131
+ [FAQ]: https://www.contributor-covenant.org/faq
132
+ [translations]: https://www.contributor-covenant.org/translations
data/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # PuppetUnitTests
2
+
3
+ Write Puppet unit tests in YAML.
4
+
5
+ Describe environment (facts, Hiera data, etc.) and expected result (error,
6
+ resource in catalog, or resource not in catalog). Use stubs that may be shared
7
+ with other modules.
8
+
9
+ ## Installation
10
+
11
+ TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
12
+
13
+ Install this gem on your development and CI/CD hosts:
14
+
15
+ ```bash
16
+ /opt/puppetlabs/puppet/bin/gem install UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ Create a "test" directory under your module root. Create subdir "class" for
22
+ classes, "define" for defined types. Create YAML files inside this directories
23
+ with usecases and expected results.
24
+
25
+ TODO: write a minimal example here and create an "examples" directory.
26
+ TODO: write rake task
27
+ TODO: example CI/CD with Laminar?
28
+
29
+ ## Development
30
+
31
+ TODO: review these instructions, correct and complete them.
32
+
33
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
34
+
35
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://codeberg.org/arlol/puppet-unit-tests. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://codeberg.org/arlol/puppet-unit-tests/src/branch/main/CODE_OF_CONDUCT.md).
40
+
41
+ ## Code of Conduct
42
+
43
+ TODO: review automatic bundler code-of-conduct more thoroughly.
44
+
45
+ Everyone interacting in the Puppetunittests project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://codeberg.org/arlol/puppet-unit-tests/src/branch/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PuppetUnitTests
4
+ # Pretend to be Facter just for tests.
5
+ class FakeFacter
6
+ def initialize
7
+ @facts = {}
8
+ end
9
+
10
+ def value(fact_name)
11
+ @facts.dig(*fact_name.to_s.split("."))
12
+ rescue TypeError
13
+ nil
14
+ end
15
+
16
+ def clear
17
+ @facts.clear
18
+ end
19
+
20
+ def to_hash
21
+ @facts
22
+ end
23
+
24
+ def add(name, _opts = {}, &block)
25
+ raise "Facter.add expects a block" unless block
26
+
27
+ @facts[name.to_s] = block.call
28
+ end
29
+
30
+ def debugging(arg); end
31
+
32
+ def reset; end
33
+
34
+ def search(*paths); end
35
+
36
+ def setup_logging; end
37
+ end
38
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rake'
4
+ require 'rake/tasklib'
5
+
6
+ require_relative 'runner'
7
+
8
+ module PuppetUnitTests
9
+ # Simple rake task to execute tests.
10
+ class RakeTask < ::Rake::TaskLib
11
+ def initialize(name = :test, *args, &task_block)
12
+ super()
13
+ @name = name
14
+
15
+ desc 'Run Puppet unit tests' unless ::Rake.application.last_description
16
+ task(name, *args) do |_, task_args|
17
+ yield(*[self, task_args].slice(0, task_block.arity)) if task_block
18
+ runner = Runner.new
19
+ errors = runner.run
20
+ unless errors.empty?
21
+ pp errors
22
+ abort("Puppet unit tests failed!")
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PuppetUnitTests
4
+ # A resource that could maybe be found in a Puppet catalog.
5
+ class ResourceSpec
6
+ attr_reader :type
7
+ attr_reader :title
8
+ attr_reader :parameters
9
+
10
+ def initialize(type, title)
11
+ @type = type
12
+ @title = title
13
+ @parameters = {}
14
+ end
15
+
16
+ class << self
17
+ def parse(res_data)
18
+ rs = new(res_data["type"], res_data["title"])
19
+ return rs unless res_data["parameters"]
20
+
21
+ res_data["parameters"].each do |k, v|
22
+ rs.parameters[k] = v
23
+ end
24
+
25
+ rs
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "test_environment"
4
+ require_relative "test_data"
5
+
6
+ module PuppetUnitTests
7
+ # Test launcher.
8
+ class Runner
9
+ def initialize
10
+ @env = nil
11
+ end
12
+
13
+ def run
14
+ setup
15
+ all_errors = {}
16
+
17
+ Dir.glob("tests/class/*.yaml") do |yaml_test_file|
18
+ test_data = TestData.parse(yaml_test_file)
19
+ test_data.trusted_facts["certname"] ||= @env.nodename
20
+ errors = test_data.check(@env)
21
+ next if errors.empty?
22
+
23
+ all_errors[test_data.name] = errors
24
+ end
25
+ # TODO: test defines
26
+ # TODO: test functions
27
+ # TODO: test plans
28
+
29
+ teardown
30
+
31
+ all_errors
32
+ end
33
+
34
+ private
35
+
36
+ def setup
37
+ # TODO: create temporary environment directory
38
+ # TODO: create modules directory
39
+ # TODO: create module with test Hiera provider
40
+ # TODO: create hiera config file
41
+ # TODO: create symlink to tested module
42
+ @env = TestEnvironment.new do |e|
43
+ e.environmentpath = "tests"
44
+ e.hiera_config = "tests/hiera.yaml"
45
+ e.modulepath = "tests/modules"
46
+ end
47
+ end
48
+
49
+ def teardown
50
+ # TODO: remove temporary environment directory
51
+ end
52
+ end
53
+ end
@@ -0,0 +1,140 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "yaml"
4
+
5
+ require_relative "test_environment"
6
+ require_relative "test_usecase"
7
+ require_relative "resource_spec"
8
+
9
+ module PuppetUnitTests
10
+ # YAML test data.
11
+ class TestData
12
+ attr_reader :type
13
+ attr_reader :name
14
+ attr_reader :usecases
15
+
16
+ attr_accessor :facts
17
+ attr_accessor :server_facts
18
+ attr_accessor :trusted_facts
19
+ attr_accessor :hiera
20
+ attr_accessor :settings
21
+ attr_accessor :stubs
22
+
23
+ def initialize(type, name, usecases)
24
+ @type = type
25
+ @name = name
26
+ @usecases = usecases
27
+ end
28
+
29
+ class << self
30
+ def parse(path)
31
+ dir = File.dirname(path)
32
+ type = File.basename(dir)
33
+ name = File.basename(path, ".yaml")
34
+ data = YAML.load_file(path)
35
+ usecases = data["usecases"].map { |dn, du| TestUsecase.parse(dn, du) }
36
+ td = new(type, name, usecases)
37
+ td.facts = data["facts"] || {}
38
+ td.server_facts = data["server_facts"] || {}
39
+ td.trusted_facts = data["trusted_facts"] || {}
40
+ td.hiera = data["hiera"] || {}
41
+ td.settings = data["settings"] || {}
42
+ td.stubs = data["stubs"] || []
43
+
44
+ td
45
+ end
46
+ end
47
+
48
+ def check(env)
49
+ hiera_data = { "global" => @hiera }
50
+ errors = {}
51
+ @usecases.each do |uc|
52
+ Puppet.runtime[:facter].clear
53
+ hiera_data["usecase"] = uc.hiera
54
+ Thread.current[:hiera_data] = hiera_data
55
+
56
+ uc_errors = check_usecase(env, uc)
57
+ next if uc_errors.empty?
58
+
59
+ errors[uc.name] = uc_errors
60
+ end
61
+
62
+ errors
63
+ end
64
+
65
+ private
66
+
67
+ def check_usecase(env, uc)
68
+ if uc.error
69
+ catalog_error(env, uc, Regexp.new(uc.error))
70
+ else
71
+ catalog = catalog(env, uc)
72
+ errors = []
73
+ errors += uc.present.map { |rs| check_present(catalog, rs) }
74
+ errors += uc.absent.map { |rs| check_absent(catalog, rs) }
75
+
76
+ errors.flatten.compact
77
+ end
78
+ rescue Puppet::PreformattedError => e
79
+ [e.message]
80
+ end
81
+
82
+ def check_present(catalog, rs)
83
+ res_disp = "#{rs.type}[#{rs.title}]"
84
+ res = catalog.resource(rs.type, rs.title)
85
+ return ["missing resource #{res_disp}"] unless res
86
+ return [] if rs.parameters.empty?
87
+
88
+ rs.parameters.map do |k, v|
89
+ val = res[k]
90
+ if val == v
91
+ nil
92
+ else
93
+ "#{res_disp}##{k}: expected #{v}, got #{val}"
94
+ end
95
+ end
96
+ end
97
+
98
+ def check_absent(catalog, rs)
99
+ res_disp = "#{rs.type}[#{rs.title}]"
100
+ res = catalog.resource(rs.type, rs.title)
101
+ return [nil] unless res
102
+ return [nil] if rs.parameters.all? { |k, v| res[k] == v }
103
+
104
+ ["#{res_disp} should be absent"]
105
+ end
106
+
107
+ def catalog(env, usecase)
108
+ env.compile(
109
+ code(usecase),
110
+ facts: @facts.merge(usecase.facts),
111
+ server_facts: @server_facts.merge(usecase.server_facts),
112
+ trusted_facts: @trusted_facts.merge(usecase.trusted_facts)
113
+ )
114
+ end
115
+
116
+ def catalog_error(env, usecase, regexp)
117
+ catalog(env, usecase)
118
+ rescue Puppet::ParseError => e
119
+ if regexp.match?(e.message)
120
+ []
121
+ else
122
+ [e.message]
123
+ end
124
+ end
125
+
126
+ def code(uc)
127
+ case @type
128
+ when "class" then "include #{@name}"
129
+ when "define"
130
+ parameters = uc.parameters.map { |k, v| "#{k} => #{v.inspect}" }
131
+ <<~EOPP
132
+ #{@name} { #{uc.title}:
133
+ #{parameters.join(",\n ")}
134
+ }
135
+ EOPP
136
+ else raise "#{@type} not implemented"
137
+ end
138
+ end
139
+ end
140
+ end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "puppet"
4
+ require_relative "fake_facter"
5
+
6
+ module PuppetUnitTests
7
+ # Puppet environment for tests.
8
+ class TestEnvironment
9
+ SETTINGS_DEFAULT = {
10
+ confdir: "/dev/null",
11
+ vardir: "/dev/null",
12
+ logdir: "/dev/null",
13
+ publicdir: "/dev/null",
14
+ codedir: "/dev/null",
15
+ rundir: "/dev/null",
16
+ hiera_config: "/dev/null",
17
+ modulepath: "/dev/null",
18
+ basemodulepath: "/dev/null",
19
+ config: nil,
20
+ environmentpath: "/dev/null",
21
+ strict_variables: true,
22
+ vendormoduledir: "/dev/null"
23
+ }.freeze
24
+
25
+ attr_accessor :nodename
26
+ attr_accessor :stubs_dir
27
+
28
+ def initialize
29
+ @nodename = "testnode"
30
+ @stubsdir = Pathname.new("stubs")
31
+ @settings = SETTINGS_DEFAULT.dup
32
+ yield self if block_given?
33
+
34
+ @puppet_env = global_setup(@settings)
35
+ Puppet.push_context(
36
+ {
37
+ loaders: Puppet::Pops::Loaders.new(@puppet_env),
38
+ current_environment: @puppet_env
39
+ },
40
+ "Environment-level test context"
41
+ )
42
+ end
43
+
44
+ def hiera_config=(path)
45
+ @settings[:hiera_config] = Pathname.new(path).realpath
46
+ end
47
+
48
+ def modulepath=(path)
49
+ @settings[:modulepath] = Pathname.new(path).realpath
50
+ end
51
+
52
+ def environmentpath=(path)
53
+ @settings[:environmentpath] = Pathname.new(path).realpath
54
+ end
55
+
56
+ def compile(code, facts:, server_facts:, trusted_facts:, stubs: [])
57
+ # TODO: Puppet.features.add(:posix) { true } if facts match UNIX
58
+
59
+ code = stubs.map do |st|
60
+ stub_path = @stubsdir.join("#{st}.pp")
61
+ File.read(stub_path)
62
+ end.join($RS) + code
63
+
64
+ Puppet.runtime[:facter].clear
65
+ name = trusted_facts["certname"]
66
+ node_facts = Puppet::Node::Facts.new(name, facts)
67
+ node = Puppet::Node.new(name, parameters: {}, facts: node_facts)
68
+ trusted_info = ["remote", name, trusted_facts]
69
+ Puppet.push_context(
70
+ {
71
+ trusted_information: Puppet::Context::TrustedInformation.new(*trusted_info)
72
+ },
73
+ "Context for test code"
74
+ )
75
+ node.environment = @puppet_env
76
+ node.add_server_facts(server_facts)
77
+
78
+ Puppet[:code] = code
79
+ catalog = Puppet::Resource::Catalog.indirection.find(
80
+ node.name, use_node: node
81
+ )
82
+ Puppet::Pops::Evaluator::DeferredResolver.resolve_and_replace(
83
+ node.facts, catalog
84
+ )
85
+ Puppet.pop_context
86
+
87
+ catalog
88
+ end
89
+
90
+ private
91
+
92
+ def global_setup(settings)
93
+ Puppet.runtime[:facter] = FakeFacter.new
94
+ Puppet.settings.initialize_app_defaults(settings)
95
+
96
+ env = Puppet::Node::Environment.create(
97
+ :test_env,
98
+ [settings[:modulepath]],
99
+ Puppet::Node::Environment::NO_MANIFEST
100
+ )
101
+ loader = Puppet::Environments::Static.new(env)
102
+ Puppet.push_context(
103
+ {
104
+ environments: loader,
105
+ stringify_rich: false,
106
+ rich_data: false,
107
+ current_environment: env
108
+ },
109
+ "Top-level test context"
110
+ )
111
+
112
+ env
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "resource_spec"
4
+
5
+ module PuppetUnitTests
6
+ # A test usecase.
7
+ class TestUsecase
8
+ attr_reader :name
9
+
10
+ attr_accessor :facts
11
+ attr_accessor :server_facts
12
+ attr_accessor :trusted_facts
13
+ attr_accessor :hiera
14
+ attr_accessor :settings
15
+
16
+ attr_accessor :present
17
+ attr_accessor :absent
18
+ attr_accessor :error
19
+
20
+ def initialize(name)
21
+ @name = name
22
+ @present = []
23
+ @absent = []
24
+ @error = nil
25
+ end
26
+
27
+ class << self
28
+ def parse(name, data_usecase)
29
+ uc = new(name)
30
+ uc.facts = data_usecase["facts"] || {}
31
+ uc.server_facts = data_usecase["server_facts"] || {}
32
+ uc.trusted_facts = data_usecase["trusted_facts"] || {}
33
+ uc.hiera = data_usecase["hiera"] || {}
34
+ uc.settings = data_usecase["settings"] || {}
35
+
36
+ uc.error = data_usecase["error"]
37
+ if data_usecase.key?("present")
38
+ uc.present = data_usecase["present"].map do |rs|
39
+ ResourceSpec.parse(rs)
40
+ end
41
+ end
42
+ if data_usecase.key?("absent")
43
+ uc.present = data_usecase["absent"].map do |rs|
44
+ ResourceSpec.parse(rs)
45
+ end
46
+ end
47
+
48
+ uc
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PuppetUnitTests
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "puppet_unit_tests/version"
4
+
5
+ module PuppetUnitTests
6
+ class Error < StandardError; end
7
+ # Your code goes here...
8
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: puppet-unit-tests
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Arlo le Rouge
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: openvox
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '8.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '8.0'
26
+ description: |
27
+ Describe environment (facts, Hiera data, etc.) and expected result (error,
28
+ resource in catalog, or resource not in catalog). Use stubs that may be shared
29
+ with other modules.
30
+ email:
31
+ - jpi+puppetunittests@arlol.net
32
+ executables: []
33
+ extensions: []
34
+ extra_rdoc_files: []
35
+ files:
36
+ - CHANGELOG.md
37
+ - CODE_OF_CONDUCT.md
38
+ - README.md
39
+ - Rakefile
40
+ - lib/puppet_unit_tests.rb
41
+ - lib/puppet_unit_tests/fake_facter.rb
42
+ - lib/puppet_unit_tests/rake_task.rb
43
+ - lib/puppet_unit_tests/resource_spec.rb
44
+ - lib/puppet_unit_tests/runner.rb
45
+ - lib/puppet_unit_tests/test_data.rb
46
+ - lib/puppet_unit_tests/test_environment.rb
47
+ - lib/puppet_unit_tests/test_usecase.rb
48
+ - lib/puppet_unit_tests/version.rb
49
+ homepage: https://codeberg.org/arlol/puppet-unit-tests
50
+ licenses: []
51
+ metadata:
52
+ allowed_push_host: https://rubygems.org/
53
+ homepage_uri: https://codeberg.org/arlol/puppet-unit-tests
54
+ source_code_uri: https://codeberg.org/arlol/puppet-unit-tests.git
55
+ changelog_uri: https://codeberg.org/arlol/puppet-unit-tests/src/branch/main/CHANGELOG.md
56
+ rubygems_mfa_required: 'true'
57
+ rdoc_options: []
58
+ require_paths:
59
+ - lib
60
+ required_ruby_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ">="
63
+ - !ruby/object:Gem::Version
64
+ version: 3.2.0
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ requirements: []
71
+ rubygems_version: 3.7.1
72
+ specification_version: 4
73
+ summary: Write Puppet unit tests in YAML.
74
+ test_files: []