diff --git a/Gemfile b/Gemfile index ce5fece..c7bd184 100644 --- a/Gemfile +++ b/Gemfile @@ -9,3 +9,4 @@ end gem 'rake' gem 'puppet', puppetversion gem 'puppet-lint' +gem 'rspec-puppet' diff --git a/Rakefile b/Rakefile index 4975ab6..66b07a6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,15 +1,21 @@ +# ex: syntax=ruby ts=2 ts=2 si et require 'puppet-lint/tasks/puppet-lint' +require 'rspec/core/rake_task' + +RSpec::Core::RakeTask.new :spec do |t| + t.pattern = 'spec/*/*_spec.rb' +end Rake::Task[:lint].clear PuppetLint::RakeTask.new :lint do |config| - config.fail_on_warnings - config.ignore_paths = [ 'pkg/**/*.pp' ] - config.disable_checks = [ - '80chars', - 'class_parameter_defaults', - 'documentation', - 'autoloader_layout' - ] + config.fail_on_warnings + config.ignore_paths = [ 'pkg/**/*', 'spec/**/*' ] + config.disable_checks = [ + '80chars', + 'class_parameter_defaults', + 'documentation', + 'autoloader_layout' + ] end -task :default => [ :lint ] +task :default => [ :spec, :lint ] diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5e0f6b1 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,6 @@ +require 'rspec-puppet' + +RSpec.configure do |c| + c.module_path = File.expand(File.join(__FILE__, '..', 'fixtures', 'modules')) + c.manifest_dir = File.expand(File.join(__FILE__, '..', 'fixtures', 'manifests')) +end