How to test custom types using Rspec-puppet? -
i trying test custom_type using rspec-puppet.
puppet code
class vim::ubuntu::config { custom_multiple_files { 'line_numbers': ensure => 'present', parent_dir => '/home', file_name => '.vimrc', line => 'set number'; } }
rspec-puppet code
require 'spec_helper' describe "vim::ubuntu::config" should contain_custom_multiple_files('line_numbers').with({ 'ensure' => 'present', 'parent_dir' => '/home', 'file_name' => '.vimrc', 'line' => 'set number', }) end end
result
2) vim::ubuntu::config failure/error: }) puppet::error: puppet::parser::ast::resource failed error argumenterror: invalid resource type custom_multiple_files @ /etc/puppet/modules/vim/spec/fixtures/modules /vim/manifests/ubuntu/config.pp:7 on node ... # ./spec/classes/ubuntu_config_spec.rb:10
puppet version
puppet --version 3.4.3
custom module @ eclipse
outcome
rspec-puppet cannot find custom type custom_multiple_files
, while puppet able find , execute custom type during puppet run.
you'll need have copy of module in spec/fixtures/module folder. can use symlink add reference spec/fixtures/module custom_type_module.
Comments
Post a Comment