Nikolay Sturm's Blog

Musings about Development and Operations

Support for Parameterised Classes in Cucumber-puppet 0.2.0

| Comments

I just released version 0.2.0 of cucumber-puppet. This version adds support for parameterised classes (requires puppet version 2.6.5 or newer).

Let’s assume we have a class with two parameters:

1
2
3
class dns ($nameserver1, $nameserver2) {
  ...
}

cucumber-puppet provides a sample Given step to specify the behaviour of this class in steps/puppet.rb (NOT updated automatically):

1
2
3
4
5
6
Given a node of class "dns" with parameters:
  | name        | value      |
  | nameserver1 | ns.foo.com |
  | nameserver2 | ns.bar.com |
When I compile the catalog
...

This will create a node with just the dns class and both parameters set according to the table.

Comments