rspec spec_helper

96 views
Skip to first unread message

Markus Falb

unread,
Jun 3, 2012, 11:06:42 AM6/3/12
to puppet...@googlegroups.com
Hi,
I was playing with rspec and every time I find a possible improvement
that could be made in spec_helper or rakefile I have to change it in
every module that is using rspec tests. So maybe these things could be
centralized, I thought to myself.

I found the following module, actually.

https://github.com/puppetlabs/puppetlabs-module_spec_helper

But I am at a lost how to use it.
Is it supposed to provide a centralized spec_helper?
How to use it?
--
Kind Regards, Markus Falb

signature.asc

Jeff McCune

unread,
Jun 4, 2012, 12:06:52 PM6/4/12
to puppet...@googlegroups.com
On Sun, Jun 3, 2012 at 8:06 AM, Markus Falb <marku...@fasel.at> wrote:
> Hi,
> I was playing with rspec and every time I find a possible improvement
> that could be made in spec_helper or rakefile I have to change it in
> every module that is using rspec tests. So maybe these things could be
> centralized, I thought to myself.
>
> I found the following module, actually.
>
> https://github.com/puppetlabs/puppetlabs-module_spec_helper

I'll leave the description to Branan but please be aware that we're
actively and currently working to centralize all of this into a single
repository named puppetlabs_spec_helper. The goal of this repository
is to provide a single place that abstracts away the details of
initializing Puppet for spec testing. This includes initializing
Puppet for use with modules being spec tested.

Here's the "main" repository:
https://github.com/puppetlabs/puppetlabs_spec_helper

And the pull request where Branan is migrating the module spec helper
into the puppetlabs_spec_helper:
https://github.com/puppetlabs/puppetlabs_spec_helper/pull/4

Hope this helps,
-Jeff

Nan Liu

unread,
Jun 4, 2012, 1:05:56 PM6/4/12
to puppet...@googlegroups.com
This isn't quite ready yet until we publish the gem. When it's
published, you just need a single gem file dependency:
gem 'puppetlabs_spec_helper', '>= 0.1.0'

Here's a module example, where you can see the entire rakefile and
spec_helper have been simplified into a single line:
https://github.com/puppetlabs/puppetlabs-mysql/pull/79/files

Thanks,

Nan

Dan Carley

unread,
Jun 6, 2012, 3:15:39 AM6/6/12
to puppet...@googlegroups.com

On Jun 4, 2012 5:07 PM, "Jeff McCune" <jeff@puppetlabs.com> wrote:
> I'll leave the description to Branan but please be aware that we're
> actively and currently working to centralize all of this into a single
> repository named puppetlabs_spec_helper.  The goal of this repository
> is to provide a single place that abstracts away the details of
> initializing Puppet for spec testing.  This includes initializing
> Puppet for use with modules being spec tested.

And, by the looks of it, will depend on rspec-puppet for core functionality. Which is great news.

Reply all
Reply to author
Forward
0 new messages