diff --git a/README_DEVELOPER.md b/README_DEVELOPER.md index ae3f12a0e84..14aaa4deb9b 100644 --- a/README_DEVELOPER.md +++ b/README_DEVELOPER.md @@ -184,6 +184,30 @@ installed using [Bundler](http://gembundler.com/) Using bundler (1.1.5) Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. +# Running Tests # + +Puppet Labs projects use a common convention of using Rake to run unit tests. +The tests can be run with the following rake task: + + rake spec + # Or if using Bundler + bundle exec rake spec + +This allows the Rakefile to set up the environment beforehand if needed. This +method is how the unit tests are run in [Jenkins](https://jenkins.puppetlabs.com). + +Under the hood Puppet's tests use `rspec`. To run all of them, you can directly +use 'rspec': + + rspec + # Or if using Bundler + bundle exec rspec + +To run a single file's worth of tests (much faster!), give the filename, and use +the nested format to see the descriptions: + + rspec spec/unit/ssl/host_spec.rb --format nested + # UTF-8 Handling # As Ruby 1.9 becomes more commonly used with Puppet, developers should be aware