it{expect{is_expected.tocontain_class('nginx::resource::location')}.toraise_error(Puppet::Error,%r{Cannot create a location reference without attaching to a virtual host})}
end
context'location type missing'do
let:paramsdo
{
vhost:'vhost1'
}
end
it{expect{is_expected.tocontain_class('nginx::resource::location')}.toraise_error(Puppet::Error,%r{Cannot create a location reference without a www_root, proxy, location_alias, stub_status, fastcgi, uwsgi, location_custom_cfg, internal, try_files, location_allow, or location_deny defined in vhost1:rspec-test})}
end
context'www_root and proxy are set'do
let:paramsdo
{
vhost:'vhost1',
www_root:'/',
proxy:'http://localhost:8000/uri/'
}
end
it{expect{is_expected.tocontain_class('nginx::resource::location')}.toraise_error(Puppet::Error,%r{Cannot define both directory and proxy in vhost1:rspec-test})}