]> gitweb.fluxo.info Git - puppet-samba.git/commitdiff
setup linting and testing
authorAdam Jahn <ajjahn@gmail.com>
Sat, 11 Apr 2015 17:32:03 +0000 (13:32 -0400)
committerAdam Jahn <ajjahn@gmail.com>
Sat, 11 Apr 2015 17:32:03 +0000 (13:32 -0400)
Gemfile
Gemfile.lock
Rakefile

diff --git a/Gemfile b/Gemfile
index 0b9fdc5354ed9e5fb77e1c1aa4d3f61f16552c9b..5abd8e39f4dfa04f6b5807bf5dcab97d756c6577 100644 (file)
--- a/Gemfile
+++ b/Gemfile
@@ -1,5 +1,15 @@
-source "http://rubygems.org"
+source "https://rubygems.org"
 
-gem "rake"
-gem "puppet-lint"
-gem "puppet"
\ No newline at end of file
+group :development do
+  gem "puppet-blacksmith"
+end
+
+group :test do
+  gem "rake"
+  gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.7.0'
+  gem "puppet-lint"
+  gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
+  gem "puppet-syntax"
+  gem "puppetlabs_spec_helper"
+  gem 'rspec', '< 2.99'
+end
index 6b9032d8704fa8d3f49b4ab612dbe7842932afcb..3fbd85d0c3a21c88bff3366fa6c8c4498826d357 100644 (file)
@@ -1,18 +1,71 @@
+GIT
+  remote: https://github.com/rodjek/rspec-puppet.git
+  revision: a9a837669cf6955279f02d1d9b524dc140b9d3e8
+  specs:
+    rspec-puppet (2.0.1)
+      rspec
+
 GEM
-  remote: http://rubygems.org/
+  remote: https://rubygems.org/
   specs:
-    facter (1.6.13)
-    hiera (1.0.0)
-    puppet (3.0.1)
-      facter (~> 1.6.11)
-      hiera (~> 1.0.0)
+    CFPropertyList (2.2.8)
+    diff-lcs (1.2.5)
+    domain_name (0.5.23)
+      unf (>= 0.0.5, < 1.0.0)
+    facter (2.4.3)
+      CFPropertyList (~> 2.2.6)
+    hiera (1.3.4)
+      json_pure
+    http-cookie (1.0.2)
+      domain_name (~> 0.5)
+    json_pure (1.8.2)
+    metaclass (0.0.4)
+    mime-types (2.4.3)
+    mocha (1.1.0)
+      metaclass (~> 0.0.1)
+    netrc (0.10.3)
+    puppet (3.7.5)
+      facter (> 1.6, < 3)
+      hiera (~> 1.0)
+      json_pure
+    puppet-blacksmith (3.3.1)
+      puppet (>= 2.7.16)
+      rest-client
     puppet-lint (0.3.2)
+    puppet-syntax (2.0.0)
+      rake
+    puppetlabs_spec_helper (0.10.1)
+      mocha
+      puppet-lint
+      puppet-syntax
+      rake
+      rspec-puppet
     rake (0.9.2.2)
+    rest-client (1.8.0)
+      http-cookie (>= 1.0.2, < 2.0)
+      mime-types (>= 1.16, < 3.0)
+      netrc (~> 0.7)
+    rspec (2.14.1)
+      rspec-core (~> 2.14.0)
+      rspec-expectations (~> 2.14.0)
+      rspec-mocks (~> 2.14.0)
+    rspec-core (2.14.8)
+    rspec-expectations (2.14.5)
+      diff-lcs (>= 1.1.3, < 2.0)
+    rspec-mocks (2.14.6)
+    unf (0.1.4)
+      unf_ext
+    unf_ext (0.0.6)
 
 PLATFORMS
   ruby
 
 DEPENDENCIES
-  puppet
+  puppet (~> 3.7.0)
+  puppet-blacksmith
   puppet-lint
+  puppet-syntax
+  puppetlabs_spec_helper
   rake
+  rspec (< 2.99)
+  rspec-puppet!
index 8e7269f2d01d7d9c6b0b8faa8a19581f914c5edf..a50d6a77d0989a646a8cdfabc2e6a969b7d1a719 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,16 +1,41 @@
-require 'puppet'
-require 'rake'
+require 'puppetlabs_spec_helper/rake_tasks'
 require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
 
-# Leave this in until we're ready to write documentation
-PuppetLint.configuration.send("disable_documentation")
+# These two gems aren't always present, for instance
+# on Travis with --without development
+begin
+  require 'puppetlabs_spec_helper/rake_tasks'
+  require 'puppet_blacksmith/rake_tasks'
+rescue LoadError
+end
 
-# Ruby's version of true does not equate to puppet's version of true
-PuppetLint.configuration.send("disable_quoted_booleans")
-PuppetLint.configuration.send("disable_selector_inside_resource")
-PuppetLint.configuration.send("disable_autoloader_layout")
 PuppetLint.configuration.send("disable_80chars")
 PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}"
 
-desc "Run puppet-lint"
-task :default => [:lint]
+# 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_80chars')
+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 acceptance tests"
+RSpec::Core::RakeTask.new(:acceptance) do |t|
+  t.pattern = 'spec/acceptance'
+end
+
+desc "Run syntax, lint, and spec tests."
+task :test => [
+  :syntax,
+  :lint,
+  :spec,
+]