From the course: Puppet Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Your first rspec-puppet test - Puppet Tutorial
From the course: Puppet Essential Training
Your first rspec-puppet test
- [Instructor] Since the PDK generated an empty class and a basic test for us, we can actually run that right now just by using the rspec command in the root of the module. You can see, here's our tests that ran, and it looks like they all pass. This isn't a surprise, since it's an empty class. Running rspec directly isn't really recommended. It's actually better to use the rake command. Rake is a Ruby build tool that allows you to configure various tasks associated with your code, like packaging the module to be uploaded to the Puppet Forge, or running these rspec tests. It uses a rake file for configuration, and, in the case of the generated code, it has a number of built-in tasks. We can actually look at these by running rake dash capital T and these are all the tasks that are built in. There's a lot of things here, most of which won't actually do anything at the moment, but there are a couple of interesting ones. Rake lint…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.