From feb56d5ccd4b071ed0fd31eb9344f7cdbe080ec9 Mon Sep 17 00:00:00 2001 From: jeannegreulich Date: Fri, 24 Jan 2020 15:59:53 -0500 Subject: [PATCH] (SIMP-3430) Create Centralize spec_helpers.rb - created baseline for spec_helper.rb to do basc RSPEC configuration for SIMP module unit tests. - added some basic methods that were also in spec_helpers - added compliance markup methods for use in compliance markup unit tests. - note that you need compliance_markup in the fixtures file for these helpers to work. SIMP-3430 #comment added simp-spec-helpers --- .travis.yml | 36 +++++ Gemfile | 22 +++ Gemfile.lock | 60 +++++++++ README.md | 178 ++++++++++++++++++++++++ lib/simp/spec_helpers.rb | 198 +-------------------------- lib/simp/spec_helpers/compliance.rb | 46 +++++++ lib/simp/spec_helpers/helpers.rb | 201 +++++++++++++++++++--------- lib/simp/spec_helpers/version.rb | 2 +- simp-spec-helpers.gemspec | 9 +- 9 files changed, 493 insertions(+), 259 deletions(-) create mode 100644 .travis.yml create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 lib/simp/spec_helpers/compliance.rb diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..90720d3 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,36 @@ +--- +language: ruby +cache: bundler +sudo: false +before_install: + - rm Gemfile.lock || true +bundler_args: "--without development --path .vendor" +notifications: + email: false +rvm: + - 2.4.5 +env: + - SIMP_SKIP_NON_SIMPOS_TESTS=1 +script: + - bundle exec rake spec +before_deploy: + - bundle exec rake clobber + - "export GEM_VERSION=`ruby -r ./lib/simp/spec_helpers/version.rb -e 'puts Simp::SpecHelpers::VERSION'`" + - '[[ $TRAVIS_TAG =~ ^${GEM_VERSION}$ ]]' +deploy: + - provider: rubygems + gemspec: simp-spec-helpers.gemspec + gem: simp-spec-helpers + api_key: + secure: "need key" + on: + tags: true + rvm: 2.4.5 + condition: "($SKIP_PUBLISH != true)" + - provider: releases + api_key: + secure: "need key" + on: + tags: true + rvm: 2.4.5 + condition: "($SKIP_PUBLISH != true)" diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7864117 --- /dev/null +++ b/Gemfile @@ -0,0 +1,22 @@ +# +# SIMP_GEM_SERVERS | a space/comma delimited list of rubygem servers +# PUPPET_VERSION | specifies the version of the puppet gem to load +# FACTER_GEM_VERSION | specifies the version of the facter to load +puppetversion = ENV.fetch('PUPPET_VERSION', '~> 5.5') +gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[, ]+/) : ['https://rubygems.org'] + +gem_sources.each { |gem_source| source gem_source } + +gemspec + +gem 'puppet', puppetversion, :require => false + +if facterversion = ENV['FACTER_GEM_VERSION'] + gem 'facter', facterversion, :require => false +end + +group :test do + gem 'rspec' + gem 'puppetlabs_spec_helper' +end + diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..c80cb7a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,60 @@ +PATH + remote: . + specs: + simp-spec-helpers (0.0.2) + +GEM + remote: https://rubygems.org/ + specs: + diff-lcs (1.3) + facter (2.5.7) + fast_gettext (1.1.2) + hiera (3.6.0) + locale (2.1.2) + mocha (1.11.2) + multi_json (1.14.1) + pathspec (0.2.1) + puppet (5.5.18) + 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.4.2) + puppet-syntax (2.6.1) + puppet (>= 5) + rake + puppetlabs_spec_helper (2.14.1) + mocha (~> 1.0) + pathspec (~> 0.2.1) + puppet-lint (~> 2.0) + puppet-syntax (~> 2.0) + rspec-puppet (~> 2.0) + rake (13.0.1) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.1) + rspec-support (~> 3.9.1) + rspec-expectations (3.9.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-puppet (2.7.8) + rspec + rspec-support (3.9.2) + +PLATFORMS + ruby + +DEPENDENCIES + puppet (~> 5.5) + puppetlabs_spec_helper + rspec + simp-spec-helpers! + +BUNDLED WITH + 1.17.3 diff --git a/README.md b/README.md index 633dbcb..f828b40 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,180 @@ # rubygem-simp-spec-helpers + rspec-puppet helper methods for SIMP module testing + +[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html) +[![Build Status](https://travis-ci.org/simp/rubygem-simp-spec-helpers.svg?branch=master)](https://travis-ci.org/simp/rubygem-simp-spec-helpers) +[![Gem](https://img.shields.io/gem/v/simp-spec-helpers.svg)](https://rubygems.org/gems/simp-spec-helpers) +[![Gem_Downloads](https://img.shields.io/gem/dt/simp-spec-helpers.svg)](https://rubygems.org/gems/simp-spec-helpers) + +#### Table of Contents + + + +* [Overview](#overview) + * [This gem is part of SIMP](#this-gem-is-part-of-simp) + * [Features](#features) +* [Setup](#setup) + * [Gemfile](#gemfile) + * [Fixtures](#fixtures) +* [Usage](#usage) + * [In a Unit Test](#in-a-unit-test) + * [Environment Variables](#environment-variables) +* [Reference](#reference) +* [Limitations](#limitations) + * [Some versions of bundler fail on FIPS-enabled Systems](#some-versions-of-bundler-fail-on-fips-enabled-systems) +* [Development](#development) + * [License](#license) + * [History](#history) + + + +## Overview + +The `simp-spec-helpers` gem provides common rspec tasks to support the SIMP unit testing process. + +### This gem is part of SIMP + +This gem is part of (the build tooling for) the [System Integrity Management Platform](https://github.com/NationalSecurityAgency/SIMP), a compliance-management framework built on [Puppet](https://puppetlabs.com/). + + +### Features + +* Customizable RPM packaging based on a Puppet module's [`metadata.json`][metadata.json] +* RPM signing +* Rubygem packaging + +## Setup + +### .fixtures.yml + +You must include the compliance_markup module in your .fixtures.yml: + +``` yaml +--- +fixtures: + repositories: +... + compliance_markup: https://github.com/simp/pupmod-simp-compliance_markup +... +``` + +NOTE: The helper module sets up the hiera.yml to include the compliance +module. It should just ignore this if compliance_markup is not included +but, because of a quirk in the testing framework, it doesn't. When it +tries to compile you will get an error like: + +``` ruby + error during compilation: Evaluation Error: Error while evaluating + a Function Call, undefined method `load_typed' for nil:NilClass +``` +### Gemfile + +The Gemfile for your puppet module should have the following included (with updated +versions where necessary): + +``` ruby +group :test do + gem 'puppet', 'puppet', ENV.fetch('PUPPET_VERSION', '~> 5.5') + gem 'rspec' + gem 'rspec-puppet' + gem 'hiera-puppet-helper' + gem 'puppetlabs_spec_helper' + gem 'metadata-json-lint' + gem 'puppet-strings' + gem 'simp-spec-helpers' + gem 'simp-rspec-puppet-facts', ENV.fetch('SIMP_RSPEC_PUPPET_FACTS_VERSION', '~> 2.2') + gem 'simp-rake-helpers', ENV.fetch('SIMP_RAKE_HELPERS_VERSION', '~> 5.9') + gem 'facterdb' +end +``` + +## Usage + +### In a Unit Test + +In your puppet module, create a file spec/spec_helper.rb with the following contents: + +``` ruby +require 'simp/rspec-puppet-facts' +include Simp::RspecPuppetFacts +require 'simp/spec_helpers' +include Simp::SpecHelpers +require 'pathname' + +fixture_path = File.expand_path(File.join(__FILE__, '..', 'fixtures')) +module_name = File.basename(File.expand_path(File.join(__FILE__,'../..'))) + +global_spec_helper(fixture_path, module_name) + +# Get any local methods in spec_helper_local.rb +local_spec_helper = File.join(File.dirname(File.expand_path(__FILE__)),"spec_helper_local.rb") +require_relative 'spec_helper_local' if File.exists?(local_spec_helper) + +``` +Require the spec helper at the top of each unit test file. + +```ruby +require 'spec_helper' +``` +Place any module specific configurations or overrides in a file spec/spec_helper_local.rb. For example to use RSPEC instead of MOCHA to mock the environment place the following +in spec/spec_helper_local.rb: + +``` ruby +RSpec.configure do |c| + c.mock_framework = :rspec + c.mock_with :rspec +end +``` + +### Environment Variables + +PUPPET_DEBUG set to anything will enable debug + + + +### Available methods + +Besides the global_spec_helper that is used to set up RSPEC the following +methods are installed and can be used in your tests: + + +#### set_hieradata(hieradata) + This can be used from inside your spec tests to load custom hieradata within + any context. + + Example: + + describe 'some::class' do + context 'with version 10' do + let(:hieradata){ "#{class_name}_v10" } + ... + end + end + + Then, create a YAML file at spec/fixtures/hieradata/some__class_v10.yaml. + + Hiera will use this file as it's base of information stacked on top of + 'default.yaml' and .yaml per the defaults above. + + Note: Any colons (:) are replaced with underscores (_) in the class name. + + +#### set_environment + This can be used from inside your spec tests to set the testable environment. + You can use this to stub out an ENC. + + Example: + + context 'in the :foo environment' do + let(:environment){:foo} + ... + end + +#### normalize_compliance_results + Can be used to removed expected errors in compliance data due to test configuration. + See pupmod-simp-pupmod for example. + +### Limitations + + diff --git a/lib/simp/spec_helpers.rb b/lib/simp/spec_helpers.rb index 6600f9d..a5eeb90 100644 --- a/lib/simp/spec_helpers.rb +++ b/lib/simp/spec_helpers.rb @@ -1,200 +1,14 @@ - module Simp; end - module Simp::SpecHelpers + require 'puppetlabs_spec_helper/module_spec_helper' + require 'rspec-puppet' -def global_spec_helper(fixture_path, module_name) - - - if ENV['PUPPET_DEBUG'] - Puppet::Util::Log.level = :debug - Puppet::Util::Log.newdestination(:console) - end - - - default_hiera_config =<<-EOM ---- -version: 5 -hierarchy: - - name: SIMP Compliance Engine - lookup_key: compliance_markup::enforcement - options: - enabled_sce_versions: [2] - - name: Custom Test Hiera - path: "%{custom_hiera}.yaml" - - name: "%{module_name}" - path: "%{module_name}.yaml" - - name: Common - path: default.yaml -defaults: - data_hash: yaml_data - datadir: "stub" -EOM - - if not File.directory?(File.join(fixture_path,'hieradata')) then - FileUtils.mkdir_p(File.join(fixture_path,'hieradata')) - end - - if not File.directory?(File.join(fixture_path,'modules',module_name)) then - FileUtils.mkdir_p(File.join(fixture_path,'modules',module_name)) - end - - RSpec.configure do |c| - # If nothing else... - c.default_facts = { - :production => { - #:fqdn => 'production.rspec.test.localdomain', - :path => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin', - :concat_basedir => '/tmp' - } - } - - c.mock_framework = :rspec - c.mock_with :mocha - - c.module_path = File.join(fixture_path, 'modules') - c.manifest_dir = File.join(fixture_path, 'manifests') - - c.hiera_config = File.join(fixture_path,'hieradata','hiera.yaml') - - # Useless backtrace noise - backtrace_exclusion_patterns = [ - /spec_helper/, - /gems/ - ] - - if c.respond_to?(:backtrace_exclusion_patterns) - c.backtrace_exclusion_patterns = backtrace_exclusion_patterns - elsif c.respond_to?(:backtrace_clean_patterns) - c.backtrace_clean_patterns = backtrace_exclusion_patterns - end - - c.before(:all) do - data = YAML.load(default_hiera_config) - data.keys.each do |key| - next unless data[key].is_a?(Hash) - - if data[key][:datadir] == 'stub' - data[key][:datadir] = File.join(fixture_path, 'hieradata') - elsif data[key]['datadir'] == 'stub' - data[key]['datadir'] = File.join(fixture_path, 'hieradata') - end - end + require 'simp/spec_helpers/helpers' + include Simp::SpecHelpers::Helpers - File.open(c.hiera_config, 'w') do |f| - f.write data.to_yaml - end - end + require 'simp/spec_helpers/compliance' + include Simp::SpecHelpers::ComplianceMarkup - c.before(:each) do - @spec_global_env_temp = Dir.mktmpdir('simpspec') - - if defined?(environment) - set_environment(environment) - FileUtils.mkdir_p(File.join(@spec_global_env_temp,environment.to_s)) - end - - # ensure the user running these tests has an accessible environmentpath - Puppet[:environmentpath] = @spec_global_env_temp - Puppet[:user] = Etc.getpwuid(Process.uid).name - Puppet[:group] = Etc.getgrgid(Process.gid).name - Puppet[:digest_algorithm] = 'sha256' - - # sanitize hieradata - if defined?(hieradata) - set_hieradata(hieradata.gsub(':','_')) - elsif defined?(class_name) - set_hieradata(class_name.gsub(':','_')) - end - end - - c.after(:each) do - # clean up the mocked environmentpath - FileUtils.rm_rf(@spec_global_env_temp) - @spec_global_env_temp = nil - end - end - - Dir.glob("#{RSpec.configuration.module_path}/*").each do |dir| - begin - Pathname.new(dir).realpath - rescue - fail "ERROR: The module '#{dir}' is not installed. Tests cannot continue." - end - end -end - -# This can be used from inside your spec tests to set the testable environment. -# You can use this to stub out an ENC. -# - -# Example: -# -# context 'in the :foo environment' do -# let(:environment){:foo} -# ... -# end -# -def set_environment(environment = :production) - RSpec.configure { |c| c.default_facts['environment'] = environment.to_s } end -# This can be used from inside your spec tests to load custom hieradata within -# any context. -# -# Example: -# -# describe 'some::class' do -# context 'with version 10' do -# let(:hieradata){ "#{class_name}_v10" } -# ... -# end -# end -# -# Then, create a YAML file at spec/fixtures/hieradata/some__class_v10.yaml. -# -# Hiera will use this file as it's base of information stacked on top of -# 'default.yaml' and .yaml per the defaults above. -# -# Note: Any colons (:) are replaced with underscores (_) in the class name. - -def set_hieradata(hieradata) - RSpec.configure { |c| c.default_facts['custom_hiera'] = hieradata } -end - -def normalize_compliance_results(compliance_profile_data, section, exceptions) - normalized = Marshal.load(Marshal.dump(compliance_profile_data)) - if section == 'non_compliant' - exceptions['non_compliant'].each do |resource,params| - params.each do |param| - if normalized['non_compliant'].key?(resource) && - normalized['non_compliant'][resource]['parameters'].key?(param) - normalized['non_compliant'][resource]['parameters'].delete(param) - if normalized['non_compliant'][resource]['parameters'].empty? - normalized['non_compliant'].delete(resource) - end - end - end - end - else - normalized[section].delete_if do |item| - rm = false - Array(exceptions[section]).each do |allowed| - if allowed.is_a?(Regexp) - if allowed.match?(item) - rm = true - break - end - else - rm = (allowed == item) - end - end - rm - end - end - - normalized -end - -end diff --git a/lib/simp/spec_helpers/compliance.rb b/lib/simp/spec_helpers/compliance.rb new file mode 100644 index 0000000..5b614f8 --- /dev/null +++ b/lib/simp/spec_helpers/compliance.rb @@ -0,0 +1,46 @@ + +module Simp; end +module Simp::SpecHelpers; end +module Simp::SpecHelpers::ComplianceMarkup + +# This module contains methods use by the compliance markup unit tests. + + # This method receives the results from the compliance map run, the section + # it represents and a list of exceptions to ignore. It will + # then remove anything it is suppoed to ignore and return the results. + def normalize_compliance_results(compliance_profile_data, section, exceptions) + normalized = Marshal.load(Marshal.dump(compliance_profile_data)) + if section == 'non_compliant' + exceptions['non_compliant'].each do |resource,params| + params.each do |param| + if normalized['non_compliant'].key?(resource) && + normalized['non_compliant'][resource]['parameters'].key?(param) + normalized['non_compliant'][resource]['parameters'].delete(param) + if normalized['non_compliant'][resource]['parameters'].empty? + normalized['non_compliant'].delete(resource) + end + end + end + end + else + normalized[section].delete_if do |item| + rm = false + Array(exceptions[section]).each do |allowed| + if allowed.is_a?(Regexp) + if allowed.match?(item) + rm = true + break + end + else + rm = (allowed == item) + end + end + rm + end + end + + normalized + end + +end + diff --git a/lib/simp/spec_helpers/helpers.rb b/lib/simp/spec_helpers/helpers.rb index 230ed78..a0d0254 100644 --- a/lib/simp/spec_helpers/helpers.rb +++ b/lib/simp/spec_helpers/helpers.rb @@ -1,77 +1,156 @@ +require 'puppetlabs_spec_helper/module_spec_helper' +require 'rspec-puppet' + module Simp; end +module Simp::SpecHelpers; end + +# These modules are the modules that used to be located +# in every modules spec/spec_helpers.rb. + module Simp::SpecHelpers::Helpers -# This can be used from inside your spec tests to set the testable environment. -# You can use this to stub out an ENC. -# - -# Example: -# -# context 'in the :foo environment' do -# let(:environment){:foo} -# ... -# end -# -def set_environment(environment = :production) - RSpec.configure { |c| c.default_facts['environment'] = environment.to_s } -end + # This method does basic RSPEC configuration that common + # to most SIMP modules for unit tests. + # This code was originally in each module's spec/spec_helper.rb. + # Environment Variables that can be used to change its behavior: + # PUPPET_DEBUG set to anything will enable puppet debug + # SIMP_SPEC_MOCK_ENV set to "rspec" will mock with rpec otherwise it will + # mock with mocha + def global_spec_helper(fixture_path, module_name) -# This can be used from inside your spec tests to load custom hieradata within -# any context. -# -# Example: -# -# describe 'some::class' do -# context 'with version 10' do -# let(:hieradata){ "#{class_name}_v10" } -# ... -# end -# end -# -# Then, create a YAML file at spec/fixtures/hieradata/some__class_v10.yaml. -# -# Hiera will use this file as it's base of information stacked on top of -# 'default.yaml' and .yaml per the defaults above. -# -# Note: Any colons (:) are replaced with underscores (_) in the class name. - -def set_hieradata(hieradata) - RSpec.configure { |c| c.default_facts['custom_hiera'] = hieradata } -end + require 'yaml' + require 'fileutils' + + if ENV['PUPPET_DEBUG'] + Puppet::Util::Log.level = :debug + Puppet::Util::Log.newdestination(:console) + end + + default_hiera_config =<<~EOM + --- + version: 5 + hierarchy: + - name: SIMP Compliance Engine + lookup_key: compliance_markup::enforcement + options: + enabled_sce_versions: [2] + - name: Custom Test Hiera + path: "%{custom_hiera}.yaml" + - name: "%{module_name}" + path: "%{module_name}.yaml" + - name: Common + path: default.yaml + defaults: + data_hash: yaml_data + datadir: "stub" + EOM + + if not File.directory?(File.join(fixture_path,'hieradata')) then + FileUtils.mkdir_p(File.join(fixture_path,'hieradata')) + end + + if not File.directory?(File.join(fixture_path,'modules',module_name)) then + FileUtils.mkdir_p(File.join(fixture_path,'modules',module_name)) + end + + RSpec.configure do |c| + # If nothing else... + c.default_facts = { + :production => { + #:fqdn => 'production.rspec.test.localdomain', + :path => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin', + :concat_basedir => '/tmp' + } + } + + c.mock_framework = :rspec + c.mock_with :mocha + + c.module_path = File.join(fixture_path, 'modules') + c.manifest_dir = File.join(fixture_path, 'manifests') + + c.hiera_config = File.join(fixture_path,'hieradata','hiera.yaml') + + # Useless backtrace noise + backtrace_exclusion_patterns = [ + /spec_helper/, + /gems/ + ] + + if c.respond_to?(:backtrace_exclusion_patterns) + c.backtrace_exclusion_patterns = backtrace_exclusion_patterns + elsif c.respond_to?(:backtrace_clean_patterns) + c.backtrace_clean_patterns = backtrace_exclusion_patterns + end -def normalize_compliance_results(compliance_profile_data, section, exceptions) - normalized = Marshal.load(Marshal.dump(compliance_profile_data)) - if section == 'non_compliant' - exceptions['non_compliant'].each do |resource,params| - params.each do |param| - if normalized['non_compliant'].key?(resource) && - normalized['non_compliant'][resource]['parameters'].key?(param) - normalized['non_compliant'][resource]['parameters'].delete(param) - if normalized['non_compliant'][resource]['parameters'].empty? - normalized['non_compliant'].delete(resource) + c.before(:all) do + data = YAML.load(default_hiera_config) + data.keys.each do |key| + next unless data[key].is_a?(Hash) + + if data[key][:datadir] == 'stub' + data[key][:datadir] = File.join(fixture_path, 'hieradata') + elsif data[key]['datadir'] == 'stub' + data[key]['datadir'] = File.join(fixture_path, 'hieradata') end end + + File.open(c.hiera_config, 'w') do |f| + f.write data.to_yaml + end end - end - else - normalized[section].delete_if do |item| - rm = false - Array(exceptions[section]).each do |allowed| - if allowed.is_a?(Regexp) - if allowed.match?(item) - rm = true - break - end - else - rm = (allowed == item) + + c.before(:each) do + @spec_global_env_temp = Dir.mktmpdir('simpspec') + + if defined?(environment) + set_environment(environment) + FileUtils.mkdir_p(File.join(@spec_global_env_temp,environment.to_s)) + end + + # ensure the user running these tests has an accessible environmentpath + Puppet[:environmentpath] = @spec_global_env_temp + Puppet[:user] = Etc.getpwuid(Process.uid).name + Puppet[:group] = Etc.getgrgid(Process.gid).name + Puppet[:digest_algorithm] = 'sha256' + + # sanitize hieradata + if defined?(hieradata) + set_hieradata(hieradata.gsub(':','_')) + elsif defined?(class_name) + set_hieradata(class_name.gsub(':','_')) end end - rm + + c.after(:each) do + # clean up the mocked environmentpath + FileUtils.rm_rf(@spec_global_env_temp) + @spec_global_env_temp = nil + end + end + + Dir.glob("#{RSpec.configuration.module_path}/*").each do |dir| + begin + Pathname.new(dir).realpath + rescue + fail "ERROR: The module '#{dir}' is not installed. Tests cannot continue." + end end end - normalized -end + # This can be used from inside your spec tests to set the testable environment. + # You can use this to stub out an ENC. + # + def set_environment(environment = :production) + RSpec.configure { |c| c.default_facts['environment'] = environment.to_s } + end + + # This can be used from inside your spec tests to load custom hieradata within + # any context. + # + def set_hieradata(hieradata) + RSpec.configure { |c| c.default_facts['custom_hiera'] = hieradata } + end end diff --git a/lib/simp/spec_helpers/version.rb b/lib/simp/spec_helpers/version.rb index 1c7233c..b5a4fea 100644 --- a/lib/simp/spec_helpers/version.rb +++ b/lib/simp/spec_helpers/version.rb @@ -1,5 +1,5 @@ module Simp; end module Simp::SpecHelpers - VERSION = '0.0.1' + VERSION = '0.0.2' end diff --git a/simp-spec-helpers.gemspec b/simp-spec-helpers.gemspec index 12e1cb7..2048ae5 100644 --- a/simp-spec-helpers.gemspec +++ b/simp-spec-helpers.gemspec @@ -12,16 +12,15 @@ Gem::Specification.new do |s| EOF s.version = Simp::SpecHelpers::VERSION s.license = 'Apache-2.0' - s.authors = ['Chris Tessmer','Trevor Vaughan'] + s.authors = ['SIMP Team'] s.email = 'simp@simp-project.org' s.homepage = 'https://github.com/simp/rubygem-simp-spec-helpers' s.metadata = { 'issue_tracker' => 'https://simp-project.atlassian.net' } - - # s.add_runtime_dependency 'net-telnet', '~> 0.1.1' - - ### s.files = Dir['Rakefile', '{bin,lib,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z .`.split("\0") + s.add_development_dependency 'puppetlabs_spec_helper', '~> 0' + s.add_development_dependency 'puppet', '>= 5.5' + s.add_development_dependency 'rspec', '~> 3.2' s.files = `git ls-files`.split("\n") s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }