Rakefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. require 'puppetlabs_spec_helper/rake_tasks'
  2. require 'puppet-lint/tasks/puppet-lint'
  3. require 'puppet-syntax/tasks/puppet-syntax'
  4. # These two gems aren't always present, for instance
  5. # on Travis with --without development
  6. begin
  7. require 'puppet_blacksmith/rake_tasks'
  8. rescue LoadError
  9. end
  10. # Prepend lib's fload path
  11. current_path = Pathname(__FILE__).dirname
  12. lib_path = current_path + 'lib'
  13. $:.unshift(lib_path.to_s)
  14. PuppetLint.configuration.send("disable_80chars")
  15. PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
  16. PuppetLint.configuration.fail_on_warnings = true
  17. # Forsake support for Puppet 2.6.2 for the benefit of cleaner code.
  18. # http://puppet-lint.com/checks/class_parameter_defaults/
  19. PuppetLint.configuration.send('disable_class_parameter_defaults')
  20. # http://puppet-lint.com/checks/class_inherits_from_params_class/
  21. PuppetLint.configuration.send('disable_class_inherits_from_params_class')
  22. exclude_paths = [
  23. "pkg/**/*",
  24. "vendor/**/*",
  25. "spec/**/*",
  26. ]
  27. PuppetLint.configuration.ignore_paths = exclude_paths
  28. PuppetSyntax.exclude_paths = exclude_paths
  29. desc "Run acceptance tests"
  30. RSpec::Core::RakeTask.new(:acceptance) do |t|
  31. t.pattern = 'spec/acceptance'
  32. end
  33. desc "Run syntax, lint, and spec tests."
  34. task :test => [
  35. :syntax,
  36. :lint,
  37. :spec,
  38. ]