[chef] Re: Re: Re: Re: Using Minitest for "Other" Resources


Chronological Thread 
  • From: David Petzel < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Using Minitest for "Other" Resources
  • Date: Thu, 1 Nov 2012 22:29:00 -0400

On Thu, Nov 1, 2012 at 5:59 PM, John Dewey < " target="_blank"> > wrote:
I've used something similar to the following in the past:

erm, how about this for resource "foo"?

require 'minitest/chef' # or require 'minitest-chef' ??
MiniTest::Chef::Resources.register_resource(:foo)

Some really great answers!!

John, Your approach was uber simple and directly addressed the specific use case I provided, and did the trick.

Bryan, Your answer addressed my wider question of "other resources". I couldn't get the exact code you gave me working, however it made things click for me, so I was able to get the following working:

require 'minitest-chef-handler'
MiniTest::Chef::Resources.register_resource(:chef_gem)
describe_recipe 'my_recipe::default' do
  it "installs the gem with the proper version" do
    chef_gem("foo").must_be_installed.with(:version, "0.1.0")
  end
end

Thanks again!! 




Archive powered by MHonArc 2.6.16.

§