forked from petems/petems-hiera_vault
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request petems#9 from fuero/rspec-tests
Unit tests
- Loading branch information
Showing
9 changed files
with
512 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
modules/ | ||
|
||
# emacs turds | ||
*\~ | ||
.*\~ | ||
\#* | ||
.\#* | ||
|
||
# macOS Finder turds | ||
.DS_Store | ||
|
||
# AppleDouble resource forks | ||
._* | ||
|
||
# Prevent accidental private key commits | ||
.ssh | ||
.bundle/ | ||
.idea/ | ||
coverage/ | ||
vendor/bundle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--format documentation | ||
--color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
source ENV['GEM_SOURCE'] || 'https://rubygems.org' | ||
|
||
puppetversion = ENV.key?('PUPPET_VERSION') ? ENV['PUPPET_VERSION'] : ['>= 3.3'] | ||
|
||
gem 'facter', '>= 1.7.0' | ||
gem 'metadata-json-lint' | ||
gem 'puppet', puppetversion | ||
gem 'rake' | ||
gem 'rubocop' | ||
gem 'vault' | ||
|
||
# # rspec must be v2 for ruby 1.8.7 | ||
# if RUBY_VERSION >= '1.8.7' && RUBY_VERSION < '1.9' | ||
# gem 'rspec', '~> 2.0' | ||
# gem 'rake', '~> 10.0' | ||
# else | ||
# # rubocop requires ruby >= 1.9 | ||
# gem 'rubocop' | ||
# end | ||
|
||
group :development do | ||
gem 'puppet-lint', '>= 1.0.0' | ||
gem 'ruby-debug-ide' | ||
end | ||
|
||
group :test do | ||
gem 'puppetlabs_spec_helper', '>= 1.2.0' | ||
|
||
gem 'rspec' | ||
gem 'rspec-puppet' | ||
gem 'rspec-puppet-utils' | ||
|
||
gem 'simplecov' | ||
gem 'simplecov-console' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
addressable (2.5.2) | ||
public_suffix (>= 2.0.2, < 4.0) | ||
ansi (1.5.0) | ||
ast (2.4.0) | ||
aws-sigv4 (1.0.2) | ||
diff-lcs (1.3) | ||
docile (1.3.0) | ||
facter (2.5.1) | ||
fast_gettext (1.1.2) | ||
hiera (3.4.2) | ||
hirb (0.7.3) | ||
json (2.1.0) | ||
json-schema (2.8.0) | ||
addressable (>= 2.4) | ||
locale (2.1.2) | ||
metaclass (0.0.4) | ||
metadata-json-lint (2.1.0) | ||
json-schema (~> 2.8) | ||
spdx-licenses (~> 1.0) | ||
mocha (1.4.0) | ||
metaclass (~> 0.0.1) | ||
multi_json (1.13.1) | ||
parallel (1.12.1) | ||
parser (2.5.0.5) | ||
ast (~> 2.4.0) | ||
powerpack (0.1.1) | ||
public_suffix (3.0.2) | ||
puppet (5.5.0) | ||
facter (> 2.0.1, < 4) | ||
fast_gettext (~> 1.1.2) | ||
hiera (>= 3.2.1, < 4) | ||
locale (~> 2.1) | ||
multi_json (~> 1.10) | ||
puppet-lint (2.3.3) | ||
puppet-syntax (2.4.1) | ||
rake | ||
puppetlabs_spec_helper (2.6.2) | ||
mocha (~> 1.0) | ||
puppet-lint (~> 2.0) | ||
puppet-syntax (~> 2.0) | ||
rspec-puppet (~> 2.0) | ||
rainbow (3.0.0) | ||
rake (12.3.1) | ||
rspec (3.7.0) | ||
rspec-core (~> 3.7.0) | ||
rspec-expectations (~> 3.7.0) | ||
rspec-mocks (~> 3.7.0) | ||
rspec-core (3.7.1) | ||
rspec-support (~> 3.7.0) | ||
rspec-expectations (3.7.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.7.0) | ||
rspec-mocks (3.7.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.7.0) | ||
rspec-puppet (2.6.11) | ||
rspec | ||
rspec-puppet-utils (3.4.0) | ||
mocha | ||
puppet | ||
puppetlabs_spec_helper | ||
rspec | ||
rspec-puppet | ||
rspec-support (3.7.1) | ||
rubocop (0.54.0) | ||
parallel (~> 1.10) | ||
parser (>= 2.5) | ||
powerpack (~> 0.1) | ||
rainbow (>= 2.2.2, < 4.0) | ||
ruby-progressbar (~> 1.7) | ||
unicode-display_width (~> 1.0, >= 1.0.1) | ||
ruby-debug-ide (0.6.1) | ||
rake (>= 0.8.1) | ||
ruby-progressbar (1.9.0) | ||
simplecov (0.16.1) | ||
docile (~> 1.1) | ||
json (>= 1.8, < 3) | ||
simplecov-html (~> 0.10.0) | ||
simplecov-console (0.4.2) | ||
ansi | ||
hirb | ||
simplecov | ||
simplecov-html (0.10.2) | ||
spdx-licenses (1.1.0) | ||
unicode-display_width (1.3.0) | ||
vault (0.11.0) | ||
aws-sigv4 | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
facter (>= 1.7.0) | ||
metadata-json-lint | ||
puppet (>= 3.3) | ||
puppet-lint (>= 1.0.0) | ||
puppetlabs_spec_helper (>= 1.2.0) | ||
rake | ||
rspec | ||
rspec-puppet | ||
rspec-puppet-utils | ||
rubocop | ||
ruby-debug-ide | ||
simplecov | ||
simplecov-console | ||
vault | ||
|
||
BUNDLED WITH | ||
1.16.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require 'puppetlabs_spec_helper/rake_tasks' | ||
require 'puppet-lint/tasks/puppet-lint' | ||
require 'metadata-json-lint/rake_task' | ||
|
||
if RUBY_VERSION >= '1.9' | ||
require 'rubocop/rake_task' | ||
RuboCop::RakeTask.new | ||
end | ||
|
||
PuppetLint.configuration.send('disable_80chars') | ||
PuppetLint.configuration.relative = true | ||
PuppetLint.configuration.ignore_paths = ['spec/**/*.pp', 'pkg/**/*.pp'] | ||
|
||
desc 'Validate manifests, templates, and ruby files' | ||
task :validate do | ||
Dir['manifests/**/*.pp'].each do |manifest| | ||
sh "puppet parser validate --noop #{manifest}" | ||
end | ||
Dir['spec/**/*.rb', 'lib/**/*.rb'].each do |ruby_file| | ||
sh "ruby -c #{ruby_file}" unless ruby_file =~ %r{spec/fixtures} | ||
end | ||
Dir['templates/**/*.erb'].each do |template| | ||
sh "erb -P -x -T '-' #{template} | ruby -c" | ||
end | ||
end | ||
|
||
desc 'Run lint, validate, and spec tests.' | ||
task :test do | ||
[:lint, :validate, :spec].each do |test| | ||
Rake::Task[test].invoke | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.