[chef] Chefspec, stubbing a resource that is being generated multiple times


Chronological Thread 
  • From: William Jimenez < >
  • To:
  • Subject: [chef] Chefspec, stubbing a resource that is being generated multiple times
  • Date: Mon, 20 Apr 2015 14:39:00 -0700

Hey Everyone,
Say I am doing something like this:

%w(pkg1 pkg2 pkg3).each { |rpm|
  execute 'Remove these RPMs but not their deps' do
    command "rpm -e -v --nodeps #{rpm}"
    only_if "rpm -q #{rpm}"
  end
}

Do I have to stub out every possible execute statement this would produce?

-William



Archive powered by MHonArc 2.6.16.

§