Re: [Puppet-dev] Testing defined types

2011-07-19 Thread Brice Figureau
On 18/07/11 09:18, Tim Sharpe wrote: We have a generic create_resource matcher than can be used however for a nicer experience I also want to create specific matchers for the built in types. it { should create_resource('package', 'mysql-server').with_param('ensure', 'present') } vs it {

Re: [Puppet-dev] Testing defined types

2011-07-18 Thread Tim Sharpe
We have a generic create_resource matcher than can be used however for a nicer experience I also want to create specific matchers for the built in types. it { should create_resource('package', 'mysql-server').with_param('ensure', 'present') } vs it { should

Re: [Puppet-dev] Testing defined types

2011-07-18 Thread David Schmitt
On 18.07.2011 09:18, Tim Sharpe wrote: We have a generic create_resource matcher than can be used however for a nicer experience I also want to create specific matchers for the built in types. it { should create_resource('package', 'mysql-server').with_param('ensure', 'present') } vs it {

Re: [Puppet-dev] Testing defined types

2011-07-18 Thread Luke Kanies
On Jul 18, 2011, at 12:18 AM, Tim Sharpe wrote: We have a generic create_resource matcher than can be used however for a nicer experience I also want to create specific matchers for the built in types. it { should create_resource('package', 'mysql-server').with_param('ensure',

Re: [Puppet-dev] Testing defined types

2011-07-18 Thread Tim Sharpe
Yep, that's a good idea! On Monday, 18 July 2011 at 6:13 PM, David Schmitt wrote: On 18.07.2011 09:18, Tim Sharpe wrote: We have a generic create_resource matcher than can be used however for a nicer experience I also want to create specific matchers for the built in types. it {

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread Dan Bode
Hi, I have been thinking about an approach similar to this lately, I would love to see some sensible rspec APIs for testing Puppet code. I am happy to help you get this together (since I would like to see some standards in place ASAP) I would have a look at 2 things: you can easily tell puppet

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread Tim Sharpe
Hi Dan, Yeah, I'm focusing mainly on getting a clean RSpec API at the moment. What it looks like currently is require 'rspec-puppet' describe 'sysctl', :type = :define do let(:module_path) { '/path/to/my/modules' } let(:name) { 'baz' } let(:params) { { :value = 'foo' } } it { should

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread Nikolay Sturm
Hi, I just stumbled upon this thread and was wondering whether you have had a look at cucumber-puppet. It seems to be doing what you want, albeit with cucumber and not rspec. Cheers, Nikolay -- It's all part of my Can't-Do approach to life. Wally -- You received this message because you are

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread Luke Kanies
On Jul 17, 2011, at 4:53 PM, Tim Sharpe wrote: Hi Dan, Yeah, I'm focusing mainly on getting a clean RSpec API at the moment. What it looks like currently is require 'rspec-puppet' describe 'sysctl', :type = :define do let(:module_path) { '/path/to/my/modules' }

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread James Turnbull
Nikolay Sturm wrote: Hi, I just stumbled upon this thread and was wondering whether you have had a look at cucumber-puppet. It seems to be doing what you want, albeit with cucumber and not rspec. I think it might have something to do with Tim's abiding hatred of Cucumber. :) Regards

Re: [Puppet-dev] Testing defined types

2011-07-17 Thread Dan Bode
On Sun, Jul 17, 2011 at 10:23 PM, Luke Kanies l...@puppetlabs.com wrote: On Jul 17, 2011, at 4:53 PM, Tim Sharpe wrote: Hi Dan, Yeah, I'm focusing mainly on getting a clean RSpec API at the moment. What it looks like currently is require 'rspec-puppet' describe 'sysctl', :type

Re: [Puppet-dev] Testing defined types

2011-07-15 Thread Luke Kanies
On Jul 15, 2011, at 2:57 PM, Tim Sharpe wrote: Hi, I'm looking at setting up some tests for the defined types in my manifests (probably using rspec) to test that node foo with facts bar applying define baz with params gronk creates a catalogue with the following resources...

Re: [Puppet-dev] Testing defined types

2011-07-15 Thread Tim Sharpe
Hi Luke, Thanks, but this is not quite what I'm after. Basically I want to test that a catalogue with just the baz resource generates certain resources, so I would like a way to generate the equivalent of node 'foo' { bar { 'name': test = 'value' } } by manipulating classes like Puppet::Node