# How to write rspec-test for a class that uses 'create_resources' function

Can't figure out how to write a puppet-Rspec test for the class, that takes parameters and calls 'create_resources' for defined type, passing resources to that function.

Update: Looks like that I need to test only a httpd::vhost_template, but don't know how.

Here is the class I stuck with:

class httpd::vhosts($vhosts_config) { if$vhosts_config[use_templates] {
notice 'use templates!'

create_resources(httpd::vhost_template, $vhosts_config[vhosts]) } }  Here is the httpd::vhost_template resource definition define httpd::vhost_template ($vhost_name, $vhost_url,$vhost_order) {

$basepath = '/vagrant/httpd2_test' validate_string($vhost_name)
validate_string($vhost_url) validate_string($vhost_order)

more