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

Modulesync: rspec-puppet-facts updates #13

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
14 changes: 7 additions & 7 deletions .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
3 changes: 1 addition & 2 deletions 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
gem 'rspec-puppet', '~> 2.3'
gem 'puppetlabs_spec_helper', '>= 0.8.0'
Expand All @@ -34,5 +32,6 @@ gem 'mime-types', '~> 1.0', {"platforms"=>["ruby_18"], "groups"=>["development"]
gem 'json', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"], "groups"=>["test"]}
gem 'json_pure', '~> 1.0', {"platforms"=>["ruby_18", "ruby_19"], "groups"=>["test"]}
gem 'metadata-json-lint'
gem 'rspec-puppet-facts', '>= 1.7'

# vim:ft=ruby
16 changes: 1 addition & 15 deletions spec/classes/crane_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@
describe 'crane' do
on_supported_os.each do |os, facts|
context "os #{os}" do
let :default_facts do
facts.merge(:concat_basedir => '/tmp')
end
let(:facts) { facts }

context 'with no parameters' do
let :pre_condition do
"class {'crane':}"
end

let :facts do
default_facts
end

it "should set up the config file" do
should contain_file('/etc/crane.conf').
with({
Expand All @@ -35,10 +29,6 @@
}"
end

let :facts do
default_facts
end

it "should set the port" do
should contain_file('/etc/crane.conf').
with_content(/^endpoint: foo.example.com:5001$/)
Expand All @@ -52,10 +42,6 @@
}"
end

let :facts do
default_facts
end

it "should set the data_dir" do
should contain_file('/etc/crane.conf').
with_content(/^data_dir: foo$/)
Expand Down
4 changes: 1 addition & 3 deletions spec/classes/crane_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
describe 'crane' do
on_supported_os.each do |os, facts|
context "on #{os}" do
let :facts do
facts.merge(:concat_basedir => '/tmp')
end
let(:facts) { facts }

it { should contain_class('crane::install') }
it { should contain_class('crane::config') }
Expand Down
5 changes: 5 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
require 'rspec-puppet-facts'
include RspecPuppetFacts

add_custom_fact :concat_basedir, '/tmp'
add_custom_fact :mongodb_version, '2.4.14'
add_custom_fact :root_home, '/root'
add_custom_fact :puppetversion, Puppet.version

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