From a81980c8f512d559cb79a1d4fbbd7b2cb73e58c2 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 16:23:39 -0500 Subject: [PATCH 1/8] Remove Gemfile.lock --- Gemfile.lock | 391 --------------------------------------------------- 1 file changed, 391 deletions(-) delete mode 100644 Gemfile.lock diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 8e6516f0..00000000 --- a/Gemfile.lock +++ /dev/null @@ -1,391 +0,0 @@ -GIT - remote: git://github.com/puppetlabs/puppetlabs-strings.git - revision: eaddebbdc97e916cf12331c1ab98bb70fff86d7c - specs: - puppet-strings (0.3.1) - puppet (>= 3.7.0) - yard (~> 0.8) - -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (2.2.8) - activesupport (4.2.5) - i18n (~> 0.7) - json (~> 1.7, >= 1.7.7) - minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) - tzinfo (~> 1.1) - addressable (2.3.8) - autoparse (0.3.3) - addressable (>= 2.3.1) - extlib (>= 0.9.15) - multi_json (>= 1.0.0) - aws-sdk (1.66.0) - aws-sdk-v1 (= 1.66.0) - aws-sdk-v1 (1.66.0) - json (~> 1.4) - nokogiri (>= 1.4.4) - backports (3.6.7) - beaker (2.30.0) - aws-sdk (~> 1.57) - beaker-answers (~> 0.0) - beaker-hiera (~> 0.0) - docker-api - fission (~> 0.4) - fog (~> 1.25, < 1.35.0) - fog-google (~> 0.0.9) - google-api-client (~> 0.8) - hocon (~> 0.1) - inifile (~> 2.0) - json (~> 1.8) - mime-types (~> 2.99) - minitest (~> 5.4) - net-scp (~> 1.2) - net-ssh (~> 2.9) - open_uri_redirections (~> 0.2.1) - rbvmomi (~> 1.8) - rsync (~> 1.0.9) - stringify-hash (~> 0.0) - unf (~> 0.1) - beaker-answers (0.3.2) - require_all (~> 1.3.2) - stringify-hash (~> 0.0.0) - beaker-hiera (0.1.1) - stringify-hash (~> 0.0.0) - beaker-rspec (5.3.0) - beaker (~> 2.0) - rspec - serverspec (~> 2) - specinfra (~> 2) - builder (3.2.2) - coderay (1.1.0) - diff-lcs (1.2.5) - docker-api (1.23.0) - excon (>= 0.38.0) - json - domain_name (0.5.25) - unf (>= 0.0.5, < 1.0.0) - ethon (0.8.0) - ffi (>= 1.3.0) - excon (0.45.4) - extlib (0.9.16) - facter (2.4.4) - CFPropertyList (~> 2.2.6) - faraday (0.9.2) - multipart-post (>= 1.2, < 3) - faraday_middleware (0.10.0) - faraday (>= 0.7.4, < 0.10) - ffi (1.9.10) - fission (0.5.0) - CFPropertyList (~> 2.2) - fog (1.34.0) - fog-atmos - fog-aws (>= 0.6.0) - fog-brightbox (~> 0.4) - fog-core (~> 1.32) - fog-dynect (~> 0.0.2) - fog-ecloud (~> 0.1) - fog-google (>= 0.0.2) - fog-json - fog-local - fog-powerdns (>= 0.1.1) - fog-profitbricks - fog-radosgw (>= 0.0.2) - fog-riakcs - fog-sakuracloud (>= 0.0.4) - fog-serverlove - fog-softlayer - fog-storm_on_demand - fog-terremark - fog-vmfusion - fog-voxel - fog-xml (~> 0.1.1) - ipaddress (~> 0.5) - nokogiri (~> 1.5, >= 1.5.11) - fog-atmos (0.1.0) - fog-core - fog-xml - fog-aws (0.7.6) - fog-core (~> 1.27) - fog-json (~> 1.0) - fog-xml (~> 0.1) - ipaddress (~> 0.8) - fog-brightbox (0.10.1) - fog-core (~> 1.22) - fog-json - inflecto (~> 0.0.2) - fog-core (1.35.0) - builder - excon (~> 0.45) - formatador (~> 0.2) - fog-dynect (0.0.2) - fog-core - fog-json - fog-xml - fog-ecloud (0.3.0) - fog-core - fog-xml - fog-google (0.0.9) - fog-core - fog-json - fog-xml - fog-json (1.0.2) - fog-core (~> 1.0) - multi_json (~> 1.10) - fog-local (0.2.1) - fog-core (~> 1.27) - fog-powerdns (0.1.1) - fog-core (~> 1.27) - fog-json (~> 1.0) - fog-xml (~> 0.1) - fog-profitbricks (0.0.5) - fog-core - fog-xml - nokogiri - fog-radosgw (0.0.4) - fog-core (>= 1.21.0) - fog-json - fog-xml (>= 0.0.1) - fog-riakcs (0.1.0) - fog-core - fog-json - fog-xml - fog-sakuracloud (1.4.0) - fog-core - fog-json - fog-serverlove (0.1.2) - fog-core - fog-json - fog-softlayer (1.0.2) - fog-core - fog-json - fog-storm_on_demand (0.1.1) - fog-core - fog-json - fog-terremark (0.1.0) - fog-core - fog-xml - fog-vmfusion (0.1.0) - fission - fog-core - fog-voxel (0.1.0) - fog-core - fog-xml - fog-xml (0.1.2) - fog-core - nokogiri (~> 1.5, >= 1.5.11) - formatador (0.2.5) - gh (0.14.0) - addressable - backports - faraday (~> 0.8) - multi_json (~> 1.0) - net-http-persistent (>= 2.7) - net-http-pipeline - google-api-client (0.8.6) - activesupport (>= 3.2) - addressable (~> 2.3) - autoparse (~> 0.3) - extlib (~> 0.9) - faraday (~> 0.9) - googleauth (~> 0.3) - launchy (~> 2.4) - multi_json (~> 1.10) - retriable (~> 1.4) - signet (~> 0.6) - googleauth (0.4.2) - faraday (~> 0.9) - jwt (~> 1.4) - logging (~> 2.0) - memoist (~> 0.12) - multi_json (~> 1.11) - signet (~> 0.6) - guard (2.13.0) - formatador (>= 0.2.4) - listen (>= 2.7, <= 4.0) - lumberjack (~> 1.0) - nenv (~> 0.1) - notiffany (~> 0.0) - pry (>= 0.9.12) - shellany (~> 0.0) - thor (>= 0.18.1) - guard-rake (1.0.0) - guard - rake - hiera (3.0.5) - json_pure - highline (1.7.8) - hocon (0.9.3) - http-cookie (1.0.2) - domain_name (~> 0.5) - i18n (0.7.0) - inflecto (0.0.2) - inifile (2.0.2) - ipaddress (0.8.0) - json (1.8.3) - json_pure (1.8.3) - jwt (1.5.2) - launchy (2.4.3) - addressable (~> 2.3) - listen (3.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - little-plugger (1.1.4) - logging (2.0.0) - little-plugger (~> 1.1) - multi_json (~> 1.10) - lumberjack (1.0.9) - memoist (0.13.0) - metaclass (0.0.4) - metadata-json-lint (0.0.11) - json - spdx-licenses (~> 1.0) - method_source (0.8.2) - mime-types (2.99) - mini_portile2 (2.0.0) - minitest (5.8.3) - mocha (1.1.0) - metaclass (~> 0.0.1) - multi_json (1.11.2) - multipart-post (2.0.0) - nenv (0.2.0) - net-http-persistent (2.9.4) - net-http-pipeline (1.0.1) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (2.9.2) - net-telnet (0.1.1) - netrc (0.11.0) - nokogiri (1.6.7) - mini_portile2 (~> 2.0.0.rc2) - notiffany (0.0.8) - nenv (~> 0.1) - shellany (~> 0.0) - open_uri_redirections (0.2.1) - pry (0.9.12.6) - coderay (~> 1.0) - method_source (~> 0.8) - slop (~> 3.4) - puppet (4.3.1) - facter (> 2.0, < 4) - hiera (>= 2.0, < 4) - json_pure - puppet-blacksmith (3.3.1) - puppet (>= 2.7.16) - rest-client - puppet-lint (1.1.0) - puppet-syntax (2.0.0) - rake - puppetlabs_spec_helper (1.0.1) - mocha - puppet-lint - puppet-syntax - rake - rspec-puppet - pusher-client (0.6.2) - json - websocket (~> 1.0) - rake (10.4.2) - rb-fsevent (0.9.6) - rb-inotify (0.9.5) - ffi (>= 0.5.0) - rbvmomi (1.8.2) - builder - nokogiri (>= 1.4.1) - trollop - require_all (1.3.3) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - retriable (1.4.1) - rspec (3.4.0) - rspec-core (~> 3.4.0) - rspec-expectations (~> 3.4.0) - rspec-mocks (~> 3.4.0) - rspec-core (3.4.1) - rspec-support (~> 3.4.0) - rspec-expectations (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-its (1.2.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.4.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.4.0) - rspec-puppet (2.2.0) - rspec - rspec-support (3.4.1) - rsync (1.0.9) - serverspec (2.24.3) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.43) - sfl (2.2) - shellany (0.0.1) - signet (0.6.1) - addressable (~> 2.3) - extlib (~> 0.9) - faraday (~> 0.9) - jwt (~> 1.5) - multi_json (~> 1.10) - slop (3.6.0) - spdx-licenses (1.0.0) - json - specinfra (2.44.5) - net-scp - net-ssh (~> 2.7) - net-telnet - sfl - stringify-hash (0.0.2) - thor (0.19.1) - thread_safe (0.3.5) - travis (1.8.0) - addressable (~> 2.3) - backports - faraday (~> 0.9) - faraday_middleware (~> 0.9, >= 0.9.1) - gh (~> 0.13) - highline (~> 1.6) - launchy (~> 2.1) - pry (~> 0.9, < 0.10) - pusher-client (~> 0.4) - typhoeus (~> 0.6, >= 0.6.8) - travis-lint (2.0.0) - json - trollop (2.1.2) - typhoeus (0.8.0) - ethon (>= 0.8.0) - tzinfo (1.2.2) - thread_safe (~> 0.1) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.1) - vagrant-wrapper (2.0.3) - websocket (1.2.2) - yard (0.8.7.6) - -PLATFORMS - ruby - -DEPENDENCIES - beaker - beaker-rspec - guard-rake - metadata-json-lint - pry - puppet (~> 4.3.0) - puppet-blacksmith - puppet-lint - puppet-strings! - puppet-syntax - puppetlabs_spec_helper - rake - rspec-puppet - travis - travis-lint - vagrant-wrapper - yard From 7205f5c332dc6b2ca94a0345b1eb7469079d5da4 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 16:24:46 -0500 Subject: [PATCH 2/8] Ignore the usual bits for puppet modules --- .gitignore | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index ebf91883..024d03e7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,35 @@ .*.sw? -pkg -spec/fixtures .rspec_system .vagrant vendor +# Default .gitignore for Ruby +*.gem +*.rbc +.bundle +.config +coverage +InstalledFiles +lib/bundler/man +pkg +rdoc +spec/reports +test/tmp +test/version_tmp +tmp +Gemfile.lock + +# YARD artifacts +.yardoc +_yardoc +doc/ + +# Vim +*.swp + +# OS X +.DS_Store + +# Puppet +coverage/ +spec/fixtures/modules/* +spec/fixtures/manifests/* From c04e9e8a409eff0f761dee1bad6f9aaf3cb7f518 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 16:29:55 -0500 Subject: [PATCH 3/8] Add community puppet-lint checks --- Gemfile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Gemfile b/Gemfile index 1f9d40d6..f3d4bd5f 100644 --- a/Gemfile +++ b/Gemfile @@ -9,6 +9,18 @@ group :test do gem 'puppetlabs_spec_helper' gem 'metadata-json-lint' gem 'puppet-strings', git: 'git://github.com/puppetlabs/puppetlabs-strings.git' + gem 'puppet-lint-absolute_classname-check' + gem 'puppet-lint-alias-check' + gem 'puppet-lint-empty_string-check' + gem 'puppet-lint-file_ensure-check' + gem 'puppet-lint-file_source_rights-check' + gem 'puppet-lint-fileserver-check' + gem 'puppet-lint-leading_zero-check' + gem 'puppet-lint-spaceship_operator_without_tag-check' + gem 'puppet-lint-trailing_comma-check' + gem 'puppet-lint-undef_in_function-check' + gem 'puppet-lint-unquoted_string-check' + gem 'puppet-lint-variable_contains_upcase' end group :development do From 00c5e705c2e24a96a760d3fef5952e50d1f05412 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 16:30:02 -0500 Subject: [PATCH 4/8] Fix up the code for style - no functional changes --- manifests/certonly.pp | 2 +- manifests/init.pp | 2 +- manifests/params.pp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/certonly.pp b/manifests/certonly.pp index c7a7d4c1..bab7c05f 100644 --- a/manifests/certonly.pp +++ b/manifests/certonly.pp @@ -29,6 +29,6 @@ command => $command, path => $::path, creates => $live_path, - require => Class['letsencrypt'] + require => Class['letsencrypt'], } } diff --git a/manifests/init.pp b/manifests/init.pp index 978fd694..ad42a75f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -45,7 +45,7 @@ section => '', setting => $setting, value => $value, - require => File['/etc/letsencrypt'] + require => File['/etc/letsencrypt'], } } } diff --git a/manifests/params.pp b/manifests/params.pp index 0113ad14..e198bf69 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -11,6 +11,6 @@ $repo = 'git://github.com/letsencrypt/letsencrypt.git' $version = 'v0.1.0' $config = { - 'server' => 'https://acme-v01.api.letsencrypt.org/directory' + 'server' => 'https://acme-v01.api.letsencrypt.org/directory', } } From d32bd7eb9b2fd592fb384a250928c77784baaf4c Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 20:12:17 -0500 Subject: [PATCH 5/8] Add rubocop for linting ruby code --- .rubocop.yml | 53 +++++++++++++++++++++++++++++++++++++++++ Gemfile | 1 + Rakefile | 66 +++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 109 insertions(+), 11 deletions(-) create mode 100644 .rubocop.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 00000000..3439abee --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,53 @@ +--- +AllCops: +# DisplayCopNames: true + DisplayStyleGuide: true + Exclude: + - 'vendor/**/*' + - 'pkg/**/*' + - 'spec/fixtures/**/*' + - '**/Rakefile' + +# Cop's to ignore + +# With this enabled it suggests a change that will break the Gemfile +Lint/AssignmentInCondition: + Enabled: false + +Metrics/LineLength: + Enabled: false + +# This is a good idea, but does not line up the rest of the lines making it +# harder to read +Style/IndentHash: + Enabled: false + +Style/Next: + Enabled: false + +# If enabled, this cop makes it harder to understand the logic +Style/NonNilCheck: + Enabled: false + +Style/TrailingComma: + Enabled: false + +# If enabled, this cop does not like the accessor method to start with 'get_', +# with is a common pattern in the Puppet community. +Style/AccessorMethodName: + Enabled: false + +# This is a common pattern in the Puppet community. +Style/ClassAndModuleChildren: + Enabled: false + +# This is a common pattern in the Puppet community. +Style/Documentation: + Enabled: false + +# Cop's that require ruby >= 1.9 +Style/HashSyntax: + Enabled: false + +Style/BracesAroundHashParameters: + Enabled: false diff --git a/Gemfile b/Gemfile index f3d4bd5f..ddc0d5c9 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ group :test do gem 'puppet-lint-undef_in_function-check' gem 'puppet-lint-unquoted_string-check' gem 'puppet-lint-variable_contains_upcase' + gem 'rubocop' end group :development do diff --git a/Rakefile b/Rakefile index ac72a947..1490a138 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,9 @@ require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-strings/rake_tasks' +require 'rubocop/rake_task' + +RuboCop::RakeTask.new # These two gems aren't always present, for instance # on Travis with --without development @@ -10,8 +13,8 @@ begin rescue LoadError end -PuppetLint.configuration.send("disable_80chars") -PuppetLint.configuration.log_format = "%{path}:%{linenumber}:%{check}:%{KIND}:%{message}" +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}' # Forsake support for Puppet 2.6.2 for the benefit of cleaner code. # http://puppet-lint.com/checks/class_parameter_defaults/ @@ -20,25 +23,25 @@ PuppetLint.configuration.send('disable_class_parameter_defaults') PuppetLint.configuration.send('disable_class_inherits_from_params_class') exclude_paths = [ - "pkg/**/*", - "vendor/**/*", - "spec/**/*", + 'pkg/**/*', + 'vendor/**/*', + 'spec/**/*', ] PuppetLint.configuration.ignore_paths = exclude_paths PuppetSyntax.exclude_paths = exclude_paths -desc "Run metadata-json-lint" +desc 'Run metadata-json-lint' task :metadata do - out = %x{bundle exec metadata-json-lint metadata.json} - $? != 0 ? (raise out) : (puts "Metadata OK!") + out = `bundle exec metadata-json-lint metadata.json` + $CHILD_STATUS != 0 ? (fail out) : (puts 'Metadata OK!') end -desc "Run acceptance tests" +desc 'Run acceptance tests' RSpec::Core::RakeTask.new(:acceptance) do |t| - t.pattern = 'spec/acceptance' + t.pattern = 'spec/acceptance' end -desc "Run syntax, lint, and spec tests." +desc 'Run syntax, lint, and spec tests.' task :test => [ :syntax, :lint, @@ -46,3 +49,44 @@ task :test => [ :spec, ] +namespace :strings do + doc_dir = File.dirname(__FILE__) + '/doc' + git_uri = `git config --get remote.origin.url`.strip + vendor_mods = File.dirname(__FILE__) + '/.modules' + + desc 'Checkout the gh-pages branch for doc generation.' + task :checkout do + unless Dir.exist?(doc_dir) + Dir.mkdir(doc_dir) + Dir.chdir(doc_dir) do + system 'git init' + system "git remote add origin #{git_uri}" + system 'git pull' + system 'git checkout gh-pages' + end + end + end + + desc 'Generate documentation with the puppet strings command.' + task :generate do + Dir.mkdir(vendor_mods) unless Dir.exist?(vendor_mods) + system "bundle exec puppet module install puppetlabs/strings --modulepath #{vendor_mods}" + system "bundle exec puppet strings --modulepath #{vendor_mods}" + end + + desc 'Push new docs to GitHub.' + task :push do + Dir.chdir(doc_dir) do + system 'git add .' + system "git commit -m 'Updating docs for latest build.'" + system 'git push origin gh-pages' + end + end + + desc 'Run checkout, generate, and push tasks.' + task :update => [ + :checkout, + :generate, + :push, + ] +end From 4209128eeea6c159ff3131d4b2b28a56f8cd4d70 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 20:12:39 -0500 Subject: [PATCH 6/8] Change ruby code to conform with rubocop --- spec/classes/letsencrypt_spec.rb | 18 +++++++++--------- spec/defines/letsencrypt_certonly_spec.rb | 12 ++++++------ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/spec/classes/letsencrypt_spec.rb b/spec/classes/letsencrypt_spec.rb index e0f19a85..82f539bd 100644 --- a/spec/classes/letsencrypt_spec.rb +++ b/spec/classes/letsencrypt_spec.rb @@ -2,7 +2,7 @@ describe 'letsencrypt' do context 'on supported operating systems' do - let(:facts) {{ osfamily: 'Debian' }} + let(:facts) { { osfamily: 'Debian' } } it { is_expected.to compile } describe 'with defaults' do @@ -20,39 +20,39 @@ end describe 'with custom path' do - let(:params) {{ path: '/usr/lib/letsencrypt' }} + let(:params) { { path: '/usr/lib/letsencrypt' } } it { is_expected.to contain_vcsrepo('/usr/lib/letsencrypt') } it { is_expected.to contain_exec('initialize letsencrypt').with_command('/usr/lib/letsencrypt/letsencrypt-auto --agree-tos -h') } end describe 'with custom repo' do - let(:params) {{ repo: 'git://foo.com/letsencrypt.git' }} + let(:params) { { repo: 'git://foo.com/letsencrypt.git' } } it { is_expected.to contain_vcsrepo('/opt/letsencrypt').with_source('git://foo.com/letsencrypt.git') } end describe 'with custom version' do - let(:params) {{ version: 'foo' }} + let(:params) { { version: 'foo' } } it { is_expected.to contain_vcsrepo('/opt/letsencrypt').with_revision('foo') } end describe 'with custom config file' do - let(:params) {{ config_file: '/etc/letsencrypt/custom_config.ini' }} + let(:params) { { config_file: '/etc/letsencrypt/custom_config.ini' } } it { is_expected.to contain_ini_setting('/etc/letsencrypt/custom_config.ini server https://acme-v01.api.letsencrypt.org/directory') } end describe 'with custom config' do - let(:params) {{ config: { 'foo' => 'bar' }}} + let(:params) { { config: { 'foo' => 'bar' } } } it { is_expected.to contain_ini_setting('/etc/letsencrypt/cli.ini foo bar') } end describe 'with manage_config set to false' do - let(:params) {{ manage_config: false }} + let(:params) { { manage_config: false } } it { is_expected.not_to contain_ini_setting('/etc/letsencrypt/cli.ini server https://acme-v01.api.letsencrypt.org/directory') } end describe 'with manage_dependencies set to false' do - let(:params) {{ manage_dependencies: false }} + let(:params) { { manage_dependencies: false } } it 'should not contain the dependencies' do is_expected.not_to contain_package('git') is_expected.not_to contain_package('python') @@ -61,7 +61,7 @@ end context 'on supported operating systems' do - let(:facts) {{ osfamily: 'RedHat' }} + let(:facts) { { osfamily: 'RedHat' } } it 'should fail' do is_expected.to raise_error Puppet::Error, /supports Debian-based operating systems/ end diff --git a/spec/defines/letsencrypt_certonly_spec.rb b/spec/defines/letsencrypt_certonly_spec.rb index b46aac19..52a0912e 100644 --- a/spec/defines/letsencrypt_certonly_spec.rb +++ b/spec/defines/letsencrypt_certonly_spec.rb @@ -1,5 +1,5 @@ describe 'letsencrypt::certonly' do - let(:facts) {{ osfamily: 'Debian' }} + let(:facts) { { osfamily: 'Debian' } } let(:pre_condition) { 'include letsencrypt' } context 'with a single domain' do @@ -11,31 +11,31 @@ context 'with multiple domains' do let(:title) { 'foo' } - let(:params) {{ domains: ['foo.example.com', 'bar.example.com']}} + let(:params) { { domains: ['foo.example.com', 'bar.example.com'] } } it { is_expected.to contain_exec('letsencrypt certonly foo').with_command '/opt/letsencrypt/letsencrypt-auto certonly --standalone -d foo.example.com -d bar.example.com' } end context 'with custom path' do let(:title) { 'foo.example.com' } - let(:params) {{ letsencrypt_path: '/usr/lib/letsencrypt' }} + let(:params) { { letsencrypt_path: '/usr/lib/letsencrypt' } } it { is_expected.to contain_exec('letsencrypt certonly foo.example.com').with_command '/usr/lib/letsencrypt/letsencrypt-auto certonly --standalone -d foo.example.com' } end context 'with custom plugin' do let(:title) { 'foo.example.com' } - let(:params) {{ plugin: 'apache' }} + let(:params) { { plugin: 'apache' } } it { is_expected.to contain_exec('letsencrypt certonly foo.example.com').with_command '/opt/letsencrypt/letsencrypt-auto certonly --apache -d foo.example.com' } end context 'with invalid plugin' do let(:title) { 'foo.example.com' } - let(:params) {{ plugin: 'bad' }} + let(:params) { { plugin: 'bad' } } it { is_expected.to raise_error Puppet::Error } end context 'when specifying additional arguments' do let(:title) { 'foo.example.com' } - let(:params) {{ additional_args: ['--foo bar', '--baz quux'] }} + let(:params) { { additional_args: ['--foo bar', '--baz quux'] } } it { is_expected.to contain_exec('letsencrypt certonly foo.example.com').with_command '/opt/letsencrypt/letsencrypt-auto certonly --standalone -d foo.example.com --foo bar --baz quux' } end end From cad86b0b83daa3c9acd83687f6eea95561f2e82d Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 20:16:16 -0500 Subject: [PATCH 7/8] Test against newest Puppet version in v4 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b067a389..d1779203 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,3 +13,4 @@ env: - PUPPET_VERSION="~> 4.1.0" - PUPPET_VERSION="~> 4.2.0" - PUPPET_VERSION="~> 4.3.0" + - PUPPET_VERSION="~> 4" From f2043530d73a97a5331f78b266418884ed5fa5c4 Mon Sep 17 00:00:00 2001 From: Garrett Honeycutt Date: Thu, 3 Dec 2015 20:16:27 -0500 Subject: [PATCH 8/8] Test newest v4 of Puppet with strict variable checking --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d1779203..f7e09284 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,3 +14,4 @@ env: - PUPPET_VERSION="~> 4.2.0" - PUPPET_VERSION="~> 4.3.0" - PUPPET_VERSION="~> 4" + - PUPPET_VERSION="~> 4" STRICT_VARIABLES="yes"