Skip to content

Commit b6d8f57

Browse files
author
Morgan Haskel
committed
Merge pull request redhat-openstack#251 from cmurphy/rspec-puppet-2
Test updates and lint fixes
2 parents c1eef64 + dffe18d commit b6d8f57

8 files changed

Lines changed: 40 additions & 26 deletions

File tree

.sync.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
---
2+
.travis.yml:
3+
extras:
4+
- rvm: 1.8.7
5+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
6+
- rvm: 1.8.7
7+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
28
spec/spec_helper.rb:
39
unmanaged: true

.travis.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
---
2+
sudo: false
23
language: ruby
34
bundler_args: --without system_tests
45
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
56
matrix:
67
fast_finish: true
78
include:
9+
- rvm: 1.9.3
10+
env: PUPPET_GEM_VERSION="~> 3.4.0"
811
- rvm: 1.8.7
9-
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
10-
- rvm: 1.8.7
11-
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
12+
env: PUPPET_GEM_VERSION="~> 3.0"
1213
- rvm: 1.9.3
1314
env: PUPPET_GEM_VERSION="~> 3.0"
14-
- rvm: 2.0.0
15+
- rvm: 1.9.3
16+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
17+
- rvm: 2.1.5
1518
env: PUPPET_GEM_VERSION="~> 3.0"
19+
- rvm: 2.1.5
20+
env: PUPPET_GEM_VERSION="~> 3.4.0"
21+
- rvm: 2.1.5
22+
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
23+
- rvm: 1.8.7
24+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0"
25+
- rvm: 1.8.7
26+
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
1627
notifications:
1728
email: false

Gemfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
source ENV['GEM_SOURCE'] || "https://rubygems.org"
22

33
group :development, :unit_tests do
4-
gem 'rake', :require => false
54
gem 'rspec-core', '3.1.7', :require => false
6-
gem 'rspec-puppet', '~> 1.0', :require => false
75
gem 'puppetlabs_spec_helper', :require => false
8-
gem 'puppet-lint', :require => false
96
gem 'simplecov', :require => false
107
gem 'puppet_facts', :require => false
118
gem 'json', :require => false

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'puppetlabs_spec_helper/rake_tasks'
22
require 'puppet-lint/tasks/puppet-lint'
33

4-
PuppetLint.configuration.fail_on_warnings
4+
PuppetLint.configuration.fail_on_warnings = true
55
PuppetLint.configuration.send('relative')
66
PuppetLint.configuration.send('disable_80chars')
77
PuppetLint.configuration.send('disable_class_inherits_from_params_class')

manifests/config.pp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#
22
class ntp::config inherits ntp {
33

4-
if $keys_enable {
5-
$directory = ntp_dirname($keys_file)
4+
if $ntp::keys_enable {
5+
$directory = ntp_dirname($ntp::keys_file)
66
file { $directory:
7-
ensure => directory,
8-
owner => 0,
9-
group => 0,
10-
mode => '0755',
7+
ensure => directory,
8+
owner => 0,
9+
group => 0,
10+
mode => '0755',
1111
}
1212
}
1313

14-
file { $config:
14+
file { $ntp::config:
1515
ensure => file,
1616
owner => 0,
1717
group => 0,
1818
mode => '0644',
19-
content => template($config_template),
19+
content => template($ntp::config_template),
2020
}
2121

2222
}

manifests/install.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#
22
class ntp::install inherits ntp {
33

4-
if $package_manage {
4+
if $ntp::package_manage {
55

6-
package { $package_name:
7-
ensure => $package_ensure,
6+
package { $ntp::package_name:
7+
ensure => $ntp::package_ensure,
88
}
99

1010
}

manifests/service.pp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#
22
class ntp::service inherits ntp {
33

4-
if ! ($service_ensure in [ 'running', 'stopped' ]) {
4+
if ! ($ntp::service_ensure in [ 'running', 'stopped' ]) {
55
fail('service_ensure parameter must be running or stopped')
66
}
77

8-
if $service_manage == true {
8+
if $ntp::service_manage == true {
99
service { 'ntp':
10-
ensure => $service_ensure,
11-
enable => $service_enable,
12-
name => $service_name,
10+
ensure => $ntp::service_ensure,
11+
enable => $ntp::service_enable,
12+
name => $ntp::service_name,
1313
hasstatus => true,
1414
hasrestart => true,
1515
}

spec/classes/ntp_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@
411411
})
412412
end
413413

414-
it { expect{ subject }.to raise_error(
415-
/^The ntp module is not supported on an unsupported based system./
414+
it { expect{ catalogue }.to raise_error(
415+
/The ntp module is not supported on an unsupported based system./
416416
)}
417417
end
418418
end

0 commit comments

Comments
 (0)