Showing with 14 additions and 10 deletions.
  1. +5 −3 .travis.yml
  2. +1 −1 Gemfile
  3. +2 −2 Modulefile
  4. +1 −1 manifests/init.pp
  5. +5 −3 spec/classes/init_spec.rb
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
---
env:
- PUPPET_VERSION=2.7.23
- PUPPET_VERSION=3.3.2
- PUPPET_VERSION=3.4.2
notifications:
email: false
rvm:
- 1.9.3
- 1.8.7
- 1.9.3
- 2.0.0
matrix:
fast_finish: true
allow_failures:
- env: PUPPET_VERSION=2.7.23
- rvm: 2.0.0
language: ruby
before_script: "gem install --no-ri --no-rdoc bundler"
script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source "https://rubygems.org"

puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 0.3.2'
Expand Down
4 changes: 2 additions & 2 deletions Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'ghoneycutt-hosts'
version '2.0.0'
version '2.0.1'
source 'git://github.com/ghoneycutt/puppet-module-hosts.git'
author 'ghoneycutt'
license 'Apache License, Version 2.0'
Expand All @@ -8,4 +8,4 @@ description "Can ensure entries for localhost, localhost6, and $::fqdn,
including aliases and optionally purge unmanaged entries."
project_page 'https://github.com/ghoneycutt/puppet-module-hosts'

dependency 'puppetlabs/stdlib', '3.2.x'
dependency 'puppetlabs/stdlib', '>= 3.2.0'
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
} else {
$localhost_ensure = 'absent'
$localhost_ip = '127.0.0.1'
$my_localhost_aliases = ''
$my_localhost_aliases = undef
}

if $ipv6_localhost_enabled == true {
Expand Down
8 changes: 5 additions & 3 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
}
}

it { should compile }

it {
should contain_host('localhost').with({
'ensure' => 'absent',
Expand Down Expand Up @@ -259,7 +261,7 @@

it 'should fail' do
expect {
should include_class('hosts')
should contain_class('hosts')
}.to raise_error(Puppet::Error,/hosts::localhost_aliases must be a string or an array. Detected type is <boolean>./)
end
end
Expand Down Expand Up @@ -351,7 +353,7 @@

it 'should fail' do
expect {
should include_class('hosts')
should contain_class('hosts')
}.to raise_error(Puppet::Error,/hosts::localhost6_aliases must be a string or an array. Detected type is <boolean>./)
end
end
Expand Down Expand Up @@ -467,7 +469,7 @@

it 'should fail' do
expect {
should include_class('hosts')
should contain_class('hosts')
}.to raise_error(Puppet::Error)
end
end
Expand Down