Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Update to use new rspec-puppet-facts version #9

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config_defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Gemfile:
groups:
- 'test'
- gem: metadata-json-lint
- gem: rspec-puppet-facts
version: '>= 1.7'
.puppet-lint.rc:
default_disabled_lint_checks:
- '140chars'
Expand Down
14 changes: 7 additions & 7 deletions moduleroot/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@ rvm:
- 2.0.0
- 2.1.5
env:
- PUPPET_VERSION=3.5
- PUPPET_VERSION=3.5 FUTURE_PARSER=yes
- PUPPET_VERSION=4.0
- PUPPET_VERSION=3.5 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
- PUPPET_VERSION=3.5 FUTURE_PARSER=yes ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
- PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
matrix:
fast_finish: true
exclude:
# No support for Ruby 1.9.3 on Puppet 4.x
- rvm: 1.9.3
env: PUPPET_VERSION=4.0
env: PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
include:
# Only platforms left to support ruby 1.8.7
- rvm: 1.8.7
env: PUPPET_VERSION=3.5
env: PUPPET_VERSION=3.5 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
- rvm: 1.8.7
env: PUPPET_VERSION=3.5 FUTURE_PARSER=yes
# Only Puppet 4.x supports Ruby 2.2. Also limit the OS set we test Ruby 2.2 with.
- rvm: 2.2.3
env: PUPPET_VERSION=4.0
env: PUPPET_VERSION=4.0 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
# Only Puppet >= 4.4 supports Ruby 2.3. Also limit the OS set we test Ruby 2.3 with.
- rvm: 2.3.0
env: PUPPET_VERSION=4.4
env: PUPPET_VERSION=4.4 ONLY_OS=redhat-6-x86_64,centos-6-x86_64,redhat-7-x86_64,centos-7-x86_64
bundler_args: --without development
sudo: false
2 changes: 0 additions & 2 deletions moduleroot/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '~> 3
if RUBY_VERSION.start_with? '1.8'
gem 'rake', '< 11'
gem 'rspec', '>= 3', '< 3.2'
gem 'rspec-puppet-facts', '< 1.4.0'
else
gem 'rake'
gem 'rspec', '~> 3.0'
gem 'rspec-puppet-facts', '>= 1.5'
end
<% (@configs['required'] + (@configs['extra'] || [])).each do |gem| -%>
gem '<%= gem['gem'] %>'<%= ", '#{gem['version']}'" if gem['version'] %><%= ", #{gem['options'].inspect}" if gem['options'] %>
Expand Down
6 changes: 6 additions & 0 deletions moduleroot/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
require 'rspec-puppet-facts'
include RspecPuppetFacts

# Original fact sources:
add_custom_fact :concat_basedir, '/tmp' # puppetlabs-concat
add_custom_fact :mongodb_version, '2.4.14' # puppetlabs-mongodb
add_custom_fact :root_home, '/root' # puppetlabs-stdlib
add_custom_fact :puppetversion, Puppet.version # Facter, but excluded from rspec-puppet-facts

# Workaround for no method in rspec-puppet to pass undef through :params
class Undef
def inspect; 'undef'; end
Expand Down