Automating real behavior testing of your Puppet modules with Cucumber + Vagrant. Also, magic.
Add this line to your application's Gemfile:
gem 'pinocchio'And then execute:
$ bundleOr install it yourself as:
$ gem install pinocchioAdd this to your module's Rakefile:
require 'pinocchio/rake'And this to your module's features/support/env.rb:
require 'pinocchio'
require 'pinocchio/cucumber'If you will be testing network connections, you will need to specify what ports to expose to your machine in your env.rb as well, like this:
Pinocchio.config do |config|
config.exposed_ports = ['80', '443']
endLook at the provided test puppet module for a complete example of usage.
Pinocchio is a stupid wooden puppet, and therefore makes many assumptions about your workflow:
-
He assumes you already do spec tests using the
puppetlabs_spec_helpergem, as he relies on.fixtures.ymlto understand your module's dependencies. This may change in the future. -
He doesn't like sharing, so when he downloads and uses Vagrant boxes, they don't go in
$VAGRANT_HOME(aka~/.vagrant.d), but instead in~/.pinocchio/vagrant_home. You can overridevagrant_homeand many other config elements inside of thePinocchio.configblock. -
He assumes you like cucumbers. That's why he brought you all these cucumbers. He just wants you to love him!
-
Fork it
-
Create your feature branch (
git checkout -b my-new-feature) -
Commit your changes (
git commit -am 'Add some feature') -
Push to the branch (
git push origin my-new-feature) -
Wish upon a star
-
Create new Pull Request
