From 2b2a7af467d0d4563ac858201f80971c032c9faf Mon Sep 17 00:00:00 2001 From: Wes Childs Date: Mon, 20 Oct 2014 19:16:20 +0100 Subject: [PATCH] Framework for basic tests --- Rakefile | 36 ++++++++++++++++++++++++++++++ spec/classes/coverage_spec.rb | 1 + spec/classes/datadog_agent_init.rb | 5 +++++ spec/spec_helper.rb | 1 + 4 files changed, 43 insertions(+) create mode 100644 Rakefile create mode 100644 spec/classes/coverage_spec.rb create mode 100644 spec/classes/datadog_agent_init.rb create mode 100644 spec/spec_helper.rb diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..5850c81d --- /dev/null +++ b/Rakefile @@ -0,0 +1,36 @@ +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +require 'puppet-syntax/tasks/puppet-syntax' + +# These two gems aren't always present, for instance +# on Travis with --without development +begin + require 'puppet_blacksmith/rake_tasks' +rescue LoadError +end + +PuppetLint.configuration.relative = true +PuppetLint.configuration.send("disable_80chars") +PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.fail_on_warnings = true + +# Forsake support for Puppet 2.6.2 for the benefit of cleaner code. +# http://puppet-lint.com/checks/class_parameter_defaults/ +PuppetLint.configuration.send('disable_class_parameter_defaults') +# http://puppet-lint.com/checks/class_inherits_from_params_class/ +PuppetLint.configuration.send('disable_class_inherits_from_params_class') + +exclude_paths = [ + "pkg/**/*", + "vendor/**/*", + "spec/**/*", +] +PuppetLint.configuration.ignore_paths = exclude_paths +PuppetSyntax.exclude_paths = exclude_paths + +desc "Run syntax, lint, and spec tests." +task :test => [ + :syntax, + :lint, + :spec, +] diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb new file mode 100644 index 00000000..12513b83 --- /dev/null +++ b/spec/classes/coverage_spec.rb @@ -0,0 +1 @@ +at_exit { RSpec::Puppet::Coverage.report! } diff --git a/spec/classes/datadog_agent_init.rb b/spec/classes/datadog_agent_init.rb new file mode 100644 index 00000000..3df884da --- /dev/null +++ b/spec/classes/datadog_agent_init.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe 'datadog_agent' do + +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 00000000..2c6f5664 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/module_spec_helper'