Added unit tests to module
This commit is contained in:
parent
40310daf29
commit
2632cfbe59
@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp
|
|||||||
|
|
||||||
// Set *default* container specific settings.json values on container create.
|
// Set *default* container specific settings.json values on container create.
|
||||||
"settings": {
|
"settings": {
|
||||||
"terminal.integrated.shell.linux": "/bin/bash"
|
"terminal.integrated.profiles.linux": {
|
||||||
|
"bash": {
|
||||||
|
"path": "bash",
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Add the IDs of extensions you want installed when the container is created.
|
// Add the IDs of extensions you want installed when the container is created.
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"puppet.puppet-vscode",
|
"puppet.puppet-vscode",
|
||||||
"rebornix.Ruby"
|
"rebornix.Ruby"
|
||||||
]
|
],
|
||||||
|
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [],
|
"forwardPorts": [],
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"settings": {
|
"settings": {
|
||||||
"terminal.integrated.profiles.linux": {
|
"terminal.integrated.profiles.linux": {
|
||||||
"bash": {
|
"bash": {
|
||||||
"path": "bash",
|
"path": "bash"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -3,4 +3,6 @@
|
|||||||
---
|
---
|
||||||
fixtures:
|
fixtures:
|
||||||
forge_modules:
|
forge_modules:
|
||||||
# stdlib: "puppetlabs/stdlib"
|
stdlib:
|
||||||
|
repo: "puppetlabs/stdlib"
|
||||||
|
ref: "6.0.0"
|
||||||
|
@ -4,7 +4,7 @@ require:
|
|||||||
- rubocop-rspec
|
- rubocop-rspec
|
||||||
AllCops:
|
AllCops:
|
||||||
DisplayCopNames: true
|
DisplayCopNames: true
|
||||||
TargetRubyVersion: '2.4'
|
TargetRubyVersion: '2.5'
|
||||||
Include:
|
Include:
|
||||||
- "**/*.rb"
|
- "**/*.rb"
|
||||||
Exclude:
|
Exclude:
|
||||||
|
34
Gemfile
34
Gemfile
@ -13,21 +13,31 @@ def location_for(place_or_version, fake_version = nil)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments
|
|
||||||
minor_version = ruby_version_segments[0..1].join('.')
|
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||||
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false
|
||||||
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
gem "facterdb", '~> 1.18', require: false
|
||||||
|
gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false
|
||||||
|
gem "puppetlabs_spec_helper", '~> 5.0', require: false
|
||||||
|
gem "rspec-puppet-facts", '~> 2.0', require: false
|
||||||
|
gem "codecov", '~> 0.2', require: false
|
||||||
|
gem "dependency_checker", '~> 0.2', require: false
|
||||||
|
gem "parallel_tests", '= 3.12.1', require: false
|
||||||
|
gem "pry", '~> 0.10', require: false
|
||||||
|
gem "simplecov-console", '~> 0.5', require: false
|
||||||
|
gem "puppet-debugger", '~> 1.0', require: false
|
||||||
|
gem "rubocop", '= 1.6.1', require: false
|
||||||
|
gem "rubocop-performance", '= 1.9.1', require: false
|
||||||
|
gem "rubocop-rspec", '= 2.0.1', require: false
|
||||||
|
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||||
end
|
end
|
||||||
group :system_tests do
|
group :system_tests do
|
||||||
gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
|
gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw]
|
||||||
gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
gem "serverspec", '~> 2.41', require: false
|
||||||
end
|
end
|
||||||
|
|
||||||
puppet_version = ENV['PUPPET_GEM_VERSION']
|
puppet_version = ENV['PUPPET_GEM_VERSION']
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"dependencies": [
|
"dependencies": [
|
||||||
{
|
{
|
||||||
"name": "puppetlabs-stdlib",
|
"name": "puppetlabs-stdlib",
|
||||||
"version_requirement": ">= 4.0.0 < 8.1.0"
|
"version_requirement": ">= 6.0.0 < 8.5.0"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"operatingsystem_support": [
|
"operatingsystem_support": [
|
||||||
@ -33,7 +33,7 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"operatingsystem": "RedHat RHEL",
|
"operatingsystem": "RedHat",
|
||||||
"operatingsystemrelease": [
|
"operatingsystemrelease": [
|
||||||
"7",
|
"7",
|
||||||
"8"
|
"8"
|
||||||
@ -56,7 +56,7 @@
|
|||||||
"ldap",
|
"ldap",
|
||||||
"authentication"
|
"authentication"
|
||||||
],
|
],
|
||||||
"pdk-version": "2.2.0",
|
"pdk-version": "2.7.1",
|
||||||
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
|
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
|
||||||
"template-ref": "tags/2.3.0-0-g8aaceff"
|
"template-ref": "heads/main-0-gc6d4446"
|
||||||
}
|
}
|
||||||
|
13
spec/classes/config_spec.rb
Normal file
13
spec/classes/config_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nslcd::config' do
|
||||||
|
on_supported_os.each do |os, os_facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let(:facts) { os_facts }
|
||||||
|
|
||||||
|
it { is_expected.to compile.with_all_deps }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
13
spec/classes/install_spec.rb
Normal file
13
spec/classes/install_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nslcd::install' do
|
||||||
|
on_supported_os.each do |os, os_facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let(:facts) { os_facts }
|
||||||
|
|
||||||
|
it { is_expected.to compile.with_all_deps }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
13
spec/classes/nslcd_spec.rb
Normal file
13
spec/classes/nslcd_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nslcd' do
|
||||||
|
on_supported_os.each do |os, os_facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let(:facts) { os_facts }
|
||||||
|
|
||||||
|
it { is_expected.to compile.with_all_deps }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
13
spec/classes/params_spec.rb
Normal file
13
spec/classes/params_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nslcd::params' do
|
||||||
|
on_supported_os.each do |os, os_facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let(:facts) { os_facts }
|
||||||
|
|
||||||
|
it { is_expected.to compile.with_all_deps }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
13
spec/classes/service_spec.rb
Normal file
13
spec/classes/service_spec.rb
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'nslcd::service' do
|
||||||
|
on_supported_os.each do |os, os_facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let(:facts) { os_facts }
|
||||||
|
|
||||||
|
it { is_expected.to compile.with_all_deps }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user