Puppet Rspec:class 尚未评估

Puppet Rspec: class has not been evaluated

我正在为进行以下调用的人偶模块编写 rspec 测试:

lookupvar('services::service')

当我 运行 测试时,我收到以下警告: Could not look up qualified variable 'services::service'; class services has not been evaluated

我可以通过在我的 init.pp 中包含 services 模块来解决这个问题。但是,有没有办法从我的测试中要求 services 模块,例如spec_helper.rb 还是测试用例本身?

我最终将 include ::services 添加到 spec/fixtures/manifests/site.pp