aboutsummaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorTomas Barton <barton.tomas@gmail.com>2014-01-25 19:08:04 +0100
committerTomas Barton <barton.tomas@gmail.com>2014-01-25 19:08:04 +0100
commit2a0b58d6a8c2934ac2cd96364d6a3a6caee81a04 (patch)
tree40bd48a620d22d718e04b380f7fda0a7f0fc3505 /spec/spec_helper.rb
parent5486852c9e7a829209a640f031b6ee6f10bee239 (diff)
downloadpuppet-sshd-2a0b58d6a8c2934ac2cd96364d6a3a6caee81a04.tar.gz
puppet-sshd-2a0b58d6a8c2934ac2cd96364d6a3a6caee81a04.tar.bz2
testing infastructure, rspec tests
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb29
1 files changed, 17 insertions, 12 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6ba62e1..2d83617 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,16 +1,21 @@
-require 'pathname'
-dir = Pathname.new(__FILE__).parent
-$LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib')
+dir = File.expand_path(File.dirname(__FILE__))
+$LOAD_PATH.unshift File.join(dir, 'lib')
require 'puppet'
-gem 'rspec', '>= 1.2.9'
-require 'spec/autorun'
+require 'rspec'
+require 'puppetlabs_spec_helper/module_spec_helper'
+require 'rspec-hiera-puppet'
+require 'rspec-puppet/coverage'
+require 'rspec/autorun'
-Dir[File.join(File.dirname(__FILE__), 'support', '*.rb')].each do |support_file|
- require support_file
-end
+fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures'))
-# 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
+RSpec.configure do |c|
+ c.module_path = File.join(fixture_path, 'modules')
+ c.manifest_dir = File.join(fixture_path, 'manifests')
+ c.pattern = "spec/*/*_spec.rb"
end
+
+Puppet::Util::Log.level = :warning
+Puppet::Util::Log.newdestination(:console)
+
+at_exit { RSpec::Puppet::Coverage.report! } \ No newline at end of file