diff options
author | Gary Larizza <gary@puppetlabs.com> | 2012-05-09 16:38:43 -0700 |
---|---|---|
committer | Gary Larizza <gary@puppetlabs.com> | 2012-05-09 16:38:43 -0700 |
commit | 580e831fbb7ba60cc0206661a8cfe263613c2b5e (patch) | |
tree | 5ea4f7ae5ef95e72433e046aed367cf07bfb9172 /spec/spec_helper.rb | |
parent | 01d46be262154b76ffd794fadf0d43deeb425fa6 (diff) |
Commit spec tests for the haproxy module
Previously, the haproxy module didn't provide rspec tests for the class
or defined resource types. This commit adds the tests, a spec_helper
file, and a rakefile so you can do `rake spec` and automatically run the
tests.
I've also committed a symlink in the
spec/fixtures/modules/haproxy directory so the rspec-puppet tests will
FIND the haproxy class/defined resource types, but I HAVE NOT committed
a symlink so that it will find the concat class (which is a dependency
for this module). If you choose to run the tests, you must symlink the
concat module in the spec/fixtures/modules directory before the spec
tests will pass.
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5fda588..9dbbf18 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,17 +1,13 @@ -dir = File.expand_path(File.dirname(__FILE__)) -$LOAD_PATH.unshift File.join(dir, 'lib') - -require 'mocha' require 'puppet' -require 'rspec' -require 'spec/autorun' +require 'rubygems' +require 'rspec-puppet' -Spec::Runner.configure do |config| - config.mock_with :mocha +fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) +RSpec.configure do |c| + c.module_path = File.join(fixture_path, 'modules') + c.manifest_dir = File.join(fixture_path, 'manifests') end -# We need this because the RAL uses 'should' as a method. This -# allows us the same behaviour but with a different method name. class Object alias :must :should end |