- From: Bryan Berry <
>
- To:
- Subject: [chef] Re: Re: Using Minitest for "Other" Resources
- Date: Thu, 1 Nov 2012 22:53:42 +0100
erm, how about this for resource "foo"?
require 'minitest/chef' # or require 'minitest-chef' ??
MiniTest::Chef::Resources.register_resource(:foo)
or if that doesn't work, re-opening the module
module MiniTest
module Chef
module Resources
register_resource(:foo)
end
end
end
just an idea
On Thu, Nov 1, 2012 at 10:34 PM, David Petzel
<
>
wrote:
>
Any chance, someone has any advice for me on this? I've restored to doing a
>
system call and gem list as a totally hack workaround, given the multitude
>
of ways it could not work right, but my ruby skillz are not top notch, and
>
I'm struggling to understand how I might expose the resource for testing
>
like shown below.
>
>
Any advice at all would be greatly appreciated.
>
Thanks
>
>
>
On Wed, Oct 31, 2012 at 11:36 AM,
>
<
>
>
wrote:
>
>
>
> Sorry if this is a dumb question, but I'm not having much luck in finding
>
> an
>
> answer.
>
>
>
> I've been using minitests for a short while now in my recipes, so I have a
>
> basic understanding of how it works. What I'm trying to figure out is how
>
> to
>
> test a resource that is not one of the pre-defined ones here:
>
>
>
> https://github.com/calavera/minitest-chef-handler/blob/master/lib/minitest-chef-handler/resources.rb#L31
>
>
>
> Specifically what I'm trying to do is something like:
>
> chef_gem("blah").must_be_installed
>
>
>
> Whats the best/proper way to be able to that? I tried the above, and it of
>
> course didn't work. I was also trying to see if I could use the
>
> pre-defined
>
> package resource and specify the provider, like you might do in a recipe,
>
> without success.
>
>
Archive powered by MHonArc 2.6.16.