How to test custom types using Rspec-puppet?

前端 未结 2 1082
南旧
南旧 2020-12-19 23:37

I am trying to test a custom_type using rspec-puppet.

Puppet Code

class vim::ubuntu::config {
  custom_multiple_files { \'line_numbe         


        
相关标签:
2条回答
  • 2020-12-20 00:14

    You'll need to have a copy of your module in your spec/fixtures/module folder. You can also use a symlink to add a reference from spec/fixtures/module to your custom_type_module.

    Reference: https://github.com/rodjek/rspec-puppet/issues/84

    0 讨论(0)
  • 2020-12-20 00:27

    An example .fixtures.yml file inside the module's root directory:

    ---
    fixtures:
      repositories:
        concat:
          repo: 'git://github.com/puppetlabs/puppetlabs-concat.git'
          ref:  '1.0.0'
        stdlib:
          repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
          ref:  '3.2.0'
    
      symlinks:
        keepalived: "#{source_dir}"
    

    Be sure to include "require 'puppetlabs_spec_helper/rake_tasks'" in your Rakefile and adjust aforementioned paths/repos/module names.

    0 讨论(0)
提交回复
热议问题