[chef] chefspec and yum


Chronological Thread 
  • From: Rilindo Foster < >
  • To: " " < >
  • Subject: [chef] chefspec and yum
  • Date: Sat, 28 Sep 2013 23:19:44 -0500

Is there a way to to write a chef spec assertion to see if the repo will be created? Here is my default.rb:

yum_repository "x2go" do
 repo_name "x2go"
 description "x2go (replaces NX)"
 url "http://download.opensuse.org/repositories/X11:/RemoteDesktop:/x2go/RHEL_6/"
 key "http://download.opensuse.org/repositories/X11:/RemoteDesktop:/x2go/RHEL_6/repodata/repomd.xml.key"
 action :add
end


And here is my current chef spec at this point:

require 'chefspec'

describe 'x2go::default' do
 let(:chef_run) {
   ChefSpec::ChefRunner.new(:step_into => ['yum_repository']).converge 'x2go::default'
 }

 it 'should create a repo if it does not exists' do
   chef_run.converge "x2go::default"
   expect(chef_run).to create_file("x2go")
 end
end

Doesn't work, which is probably because "create_file" is used with the "file" resource, not yum_repository LWRP.

It doesn't look like chef spec supports the yum_repository LWRP (or at least that I can see), so I am not sure what direction I should take from here. What approach should I take?

- Rilindo



Archive powered by MHonArc 2.6.16.

§