On 16 February 2016 at 09:37, Thomas Bendler <[email protected]> wrote:
> Hi @all,
>
> I have a small problem with my module test using spec_puppet. I use the
> Puppetlabs MySQL module to create databases in my module. When running "rake
> spec" my coverage report that not all resources are tested:
>
> <--- snip --->
> Mysql_database[test1]
> Mysql_grant[test1@localhost/test1.*]
> Mysql_user[test1@localhost]
> <--- snap --->
>
> How can I include this resources in my spec file to get tested also? I've
> already added the classes to the spec file but this did not solve the
> problem:
>
> <--- snip --->
> it { is_expected.to contain_class('mysql::server') }
> it { is_expected.to contain_class('mysql::server::backup') }
> it { is_expected.to contain_class('mysql::server::account_security') }
> it { is_expected.to contain_class('mysql::server::mysqltuner') }
> <--- snap --->
>

You should be able to do something like the following if memory serves:

it { is_expected.to contain_mysql_database('test1') }

Gareth


> Is it necessary to create a spec file for each define? Are there any public
> examples that I can use for education?
>
> Regards Thomas
> --
> Linux ... enjoy the ride!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAELoU1Pt%3Db1zjGOLrcsp-rEbO%2Bncy_Jv-cu-bqRGXY%3DrsATkHg%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Gareth Rushgrove
@garethr

devopsweekly.com
morethanseven.net
garethrushgrove.com

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAFi_6yLVKzpin%2BQ_VYLi%2BtbswNr1KOzZbL-4Tu6idgQmU_aLRA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to