How can I rspec test a resource collector?

asked 2014-11-28 04:36:41 -0600

falaimo gravatar image

updated 2014-12-02 09:49:24 -0600

Hello, I have a yumrepo resource for which I use collector to collect all the repos and add an ordering method applying to all repos. Something like:

File['yum_repos_dir] -> Yumrepo <||> ~> Exec['clean-yum-metadata']

Now I want to setup a rspec test that not only tests this irchestration with a single case (a single repo) but for any repo in general, so I should 'translate' the collector to the test. Something like:

describe '-> orchestration validation' do
  it { should contain_ryumrepo(<||>).that_requires('File[yum_repos_dir]'
                                                                           ).that_notifies('Exec[clean-yum-metadata]'
                                                                                          )}

which obviously is not the way, but Id like to find a valid equivalent.

Thanks for any help you can provide!

edit retag flag offensive close merge delete