Commit d6c7d9fa authored by Markus Frosch's avatar Markus Frosch 📣

testing: Update private class check for an rspec environment

Especially for defined types, the value is empty in RSpec.
parent 1fda4d01
......@@ -16,7 +16,7 @@
#
class icinga2::config {
if $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name {
fail("icinga2::config is a private class of the module icinga2, you're not permitted to use it.")
}
......
......@@ -12,7 +12,7 @@ define icinga2::feature(
) {
require ::icinga2::config
if defined($caller_module_name) and $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' {
fail("icinga2::feature is a private define resource of the module icinga2, you're not permitted to use it.")
}
......
......@@ -17,7 +17,7 @@
#
class icinga2::install {
if $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name {
fail("icinga2::install is a private class of the module icinga2, you're not permitted to use it.")
}
......
......@@ -63,7 +63,7 @@ define icinga2::object(
$order,
) {
if defined($caller_module_name) and $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name and $caller_module_name != '' {
fail("icinga2::object is a private define resource of the module icinga2, you're not permitted to use it.")
}
......
......@@ -19,7 +19,7 @@
#
class icinga2::repo {
if $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name {
fail("icinga2::repo is a private class of the module icinga2, you're not permitted to use it.")
}
......
......@@ -19,7 +19,7 @@
#
class icinga2::service {
if $module_name != $caller_module_name {
if defined($caller_module_name) and $module_name != $caller_module_name {
fail("icinga2::service is a private class of the module icinga2, you're not permitted to use it.")
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment