summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Yaworski <joseph.yaworski@fireeye.com>2016-03-20 18:38:07 -0400
committerJoseph Yaworski <joseph.yaworski@fireeye.com>2016-03-20 18:51:58 -0400
commit7aa4c2a9e3107cc108448680d26b29ba63657b48 (patch)
tree59672a6d37db3519477ac363e69ece4642b52ef7
parentb740281e0cb8c3c87245a7698c0dbc849d6d66f4 (diff)
Update from voxpupuli modulesync_config
-rw-r--r--.fixtures.yml10
-rw-r--r--.rubocop.yml12
-rw-r--r--.travis.yml18
-rw-r--r--CONTRIBUTING.md19
-rw-r--r--Gemfile4
-rw-r--r--Rakefile2
-rw-r--r--metadata.json2
-rw-r--r--spec/acceptance/nodesets/centos-511-x64.yml9
-rw-r--r--spec/acceptance/nodesets/centos-66-x64-pe.yml11
-rw-r--r--spec/acceptance/nodesets/centos-66-x64.yml9
-rw-r--r--spec/acceptance/nodesets/centos-72-x64.yml9
-rw-r--r--spec/acceptance/nodesets/debian-78-x64.yml9
-rw-r--r--spec/acceptance/nodesets/debian-82-x64.yml9
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1204-x64.yml9
-rw-r--r--spec/acceptance/nodesets/ubuntu-server-1404-x64.yml8
-rw-r--r--spec/classes/coverage_spec.rb3
-rw-r--r--spec/classes/unattended_upgrades_spec.rb220
-rw-r--r--spec/spec_helper.rb2
18 files changed, 226 insertions, 139 deletions
diff --git a/.fixtures.yml b/.fixtures.yml
index 9a7e6df..90eab99 100644
--- a/.fixtures.yml
+++ b/.fixtures.yml
@@ -1,10 +1,6 @@
fixtures:
- forge_modules:
- stdlib:
- repo: "puppetlabs-stdlib"
- ref: "4.6.0"
- apt:
- repo: "puppetlabs-apt"
- ref: "2.2.0"
+ repositories:
+ apt: 'https://github.com/puppetlabs/puppetlabs-apt.git'
+ stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
symlinks:
unattended_upgrades: "#{source_dir}"
diff --git a/.rubocop.yml b/.rubocop.yml
index 7c24c48..819bbd8 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -26,18 +26,20 @@ Metrics/AbcSize:
Metrics/MethodLength:
Enabled: false
+# Module length is not necessarily an indicator of code quality
+Metrics/ModuleLength:
+ Enabled: false
+
# Class length is not necessarily an indicator of code quality
Metrics/ClassLength:
Enabled: false
# dealbreaker:
-Style/TrailingComma:
+Style/TrailingCommaInArguments:
Enabled: false
-Style/ClosingParenthesisIndentation:
+Style/TrailingCommaInLiteral:
Enabled: false
-
-# we still support ruby 1.8
-Style/HashSyntax:
+Style/ClosingParenthesisIndentation:
Enabled: false
Lint/AmbiguousRegexpLiteral:
diff --git a/.travis.yml b/.travis.yml
index 115d3c4..1b492f1 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,14 +11,23 @@ matrix:
include:
- rvm: 1.9.3
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
- - rvm: 2.1.7
+ - rvm: 2.1.8
env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test
- - rvm: 2.1.7
+ - rvm: 1.9.3
+ env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
+ - rvm: 2.1.8
+ env: PUPPET_VERSION="~> 3.0" STRICT_VARIABLES="yes" CHECK=test FUTURE_PARSER=yes
+ - rvm: 2.1.8
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
- - rvm: 2.2.3
+ - rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
- - rvm: 2.2.3
+ - rvm: 2.2.4
env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=rubocop
+ - rvm: 2.3.0
+ env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
+ allow_failures:
+ - rvm: 2.3.0
+ env: PUPPET_VERSION="~> 4.0" STRICT_VARIABLES="yes" CHECK=test
notifications:
email: false
deploy:
@@ -32,3 +41,4 @@ deploy:
all_branches: true
# Only publish if our main Ruby target builds
rvm: 1.9.3
+ condition: "$FUTURE_PARSER = yes"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1ccfba6..00deb27 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -49,18 +49,29 @@ The test suite will run [Puppet Lint](http://puppet-lint.com/) and
[Puppet Syntax](https://github.com/gds-operations/puppet-syntax) to
check various syntax and style things. You can run these locally with:
- bundle exec rake test
+ bundle exec rake lint
+ bundle exec rake validate
## Running the unit tests
The unit test suite covers most of the code, as mentioned above please
add tests if you're adding new functionality. If you've not used
[rspec-puppet](http://rspec-puppet.com/) before then feel free to ask
-about how best to test your new feature. To run your specific spec test
-you can pass it to `SPEC`:
+about how best to test your new feature.
+
+To run your all the unit tests
+
+ bundle exec rake spec SPEC_OPTS='--format documentation'
+
+To run a specific spec test set the `SPEC` variable:
bundle exec rake spec SPEC=spec/foo_spec.rb
+To run the linter, the syntax checker and the unit tests:
+
+ bundle exec rake test
+
+
## Integration tests
The unit tests just check the code runs, not that it does exactly what
@@ -76,7 +87,7 @@ with:
This will run the tests on an Ubuntu 12.04 virtual machine. You can also
run the integration tests against Centos 6.5 with.
- RS_SET=centos-64-x64 bundle exec rake acceptances
+ BEAKER_set=centos-64-x64 bundle exec rake acceptances
If you don't want to have to recreate the virtual machine every time you
can use `BEAKER_DESTROY=no` and `BEAKER_PROVISION=no`. On the first run you will
diff --git a/Gemfile b/Gemfile
index 8fa35da..66ed713 100644
--- a/Gemfile
+++ b/Gemfile
@@ -19,7 +19,7 @@ group :test do
gem 'rspec', :require => false
gem 'puppet-blacksmith', :require => false, :git => 'https://github.com/voxpupuli/puppet-blacksmith.git'
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem.git'
- gem 'rubocop', '0.35.0', :require => false
+ gem 'rubocop', '~> 0.38', :require => false
gem 'rspec-puppet-utils', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'puppet-lint-absolute_classname-check', :require => false
@@ -58,7 +58,7 @@ else
gem 'facter', :require => false, :groups => [:test]
end
-ENV['PUPPET_VERSION'].nil? ? puppetversion = '3.8.4' : puppetversion = ENV['PUPPET_VERSION'].to_s
+ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 3.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
# vim:ft=ruby
diff --git a/Rakefile b/Rakefile
index 9e39d33..0ffcb86 100644
--- a/Rakefile
+++ b/Rakefile
@@ -11,7 +11,7 @@ RuboCop::RakeTask.new
PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{check}:%{KIND}:%{message}'
PuppetLint.configuration.fail_on_warnings = true
PuppetLint.configuration.send('relative')
-PuppetLint.configuration.send('disable_80chars')
+PuppetLint.configuration.send('disable_140chars')
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
PuppetLint.configuration.send('disable_documentation')
PuppetLint.configuration.send('disable_single_quote_string_with_variables')
diff --git a/metadata.json b/metadata.json
index c495b9e..19750ae 100644
--- a/metadata.json
+++ b/metadata.json
@@ -4,7 +4,7 @@
"author": "voxpupuli",
"summary": "Provides an interface for managing Apt unattended_upgrades with Puppet",
"license": "Apache-2.0",
- "source": "https://github.com/voxpupuli/puppet-unattended_upgrades",
+ "source": "https://github.com/voxpupuli/puppet-unattended_upgrades.git",
"project_page": "https://github.com/voxpupuli/puppet-unattended_upgrades",
"issues_url": "https://github.com/voxpupuli/puppet-unattended_upgrades/issues",
"operatingsystem_support": [
diff --git a/spec/acceptance/nodesets/centos-511-x64.yml b/spec/acceptance/nodesets/centos-511-x64.yml
new file mode 100644
index 0000000..ca14463
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-511-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ centos-511-x64:
+ roles:
+ - master
+ platform: el-5-x86_64
+ box: puppetlabs/centos-5.11-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/centos-66-x64-pe.yml b/spec/acceptance/nodesets/centos-66-x64-pe.yml
new file mode 100644
index 0000000..9a93037
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-66-x64-pe.yml
@@ -0,0 +1,11 @@
+HOSTS:
+ centos-66-x64:
+ roles:
+ - master
+ - database
+ - dashboard
+ platform: el-6-x86_64
+ box: puppetlabs/centos-6.6-64-puppet-enterprise
+ hypervisor: vagrant
+CONFIG:
+ type: pe
diff --git a/spec/acceptance/nodesets/centos-66-x64.yml b/spec/acceptance/nodesets/centos-66-x64.yml
new file mode 100644
index 0000000..214318a
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-66-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ centos-66-x64:
+ roles:
+ - master
+ platform: el-6-x86_64
+ box: puppetlabs/centos-6.6-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/centos-72-x64.yml b/spec/acceptance/nodesets/centos-72-x64.yml
new file mode 100644
index 0000000..2c628fc
--- /dev/null
+++ b/spec/acceptance/nodesets/centos-72-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ centos-72-x64:
+ roles:
+ - master
+ platform: el-7-x86_64
+ box: puppetlabs/centos-7.2-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/debian-78-x64.yml b/spec/acceptance/nodesets/debian-78-x64.yml
new file mode 100644
index 0000000..2baa693
--- /dev/null
+++ b/spec/acceptance/nodesets/debian-78-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ debian-78-x64:
+ roles:
+ - master
+ platform: debian-7-amd64
+ box: puppetlabs/debian-7.8-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/debian-82-x64.yml b/spec/acceptance/nodesets/debian-82-x64.yml
new file mode 100644
index 0000000..f496f12
--- /dev/null
+++ b/spec/acceptance/nodesets/debian-82-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ debian-82-x64:
+ roles:
+ - master
+ platform: debian-8-amd64
+ box: puppetlabs/debian-8.2-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
new file mode 100644
index 0000000..fa94e2c
--- /dev/null
+++ b/spec/acceptance/nodesets/ubuntu-server-1204-x64.yml
@@ -0,0 +1,9 @@
+HOSTS:
+ ubuntu-server-1204-x64:
+ roles:
+ - master
+ platform: ubuntu-12.04-amd64
+ box: puppetlabs/ubuntu-12.04-64-nocm
+ hypervisor: vagrant
+CONFIG:
+ type: foss
diff --git a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
index cba1cd0..72ba9c2 100644
--- a/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
+++ b/spec/acceptance/nodesets/ubuntu-server-1404-x64.yml
@@ -3,9 +3,7 @@ HOSTS:
roles:
- master
platform: ubuntu-14.04-amd64
- box : puppetlabs/ubuntu-14.04-64-nocm
- box_url : https://vagrantcloud.com/puppetlabs/ubuntu-14.04-64-nocm
- hypervisor : vagrant
+ box: puppetlabs/ubuntu-14.04-64-nocm
+ hypervisor: vagrant
CONFIG:
- log_level : debug
- type: git
+ type: foss
diff --git a/spec/classes/coverage_spec.rb b/spec/classes/coverage_spec.rb
new file mode 100644
index 0000000..c083569
--- /dev/null
+++ b/spec/classes/coverage_spec.rb
@@ -0,0 +1,3 @@
+require 'rspec-puppet'
+
+at_exit { RSpec::Puppet::Coverage.report! }
diff --git a/spec/classes/unattended_upgrades_spec.rb b/spec/classes/unattended_upgrades_spec.rb
index 5943f02..dc2137f 100644
--- a/spec/classes/unattended_upgrades_spec.rb
+++ b/spec/classes/unattended_upgrades_spec.rb
@@ -4,10 +4,10 @@ describe 'unattended_upgrades' do
let(:file_unattended) { '/etc/apt/apt.conf.d/50unattended-upgrades' }
let(:file_periodic) { '/etc/apt/apt.conf.d/10periodic' }
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Debian',
- :lsbdistcodename => 'wheezy',
- :lsbrelease => '7.0.3',
+ osfamily: 'Debian',
+ lsbdistid: 'Debian',
+ lsbdistcodename: 'wheezy',
+ lsbrelease: '7.0.3',
} }
let(:pre_condition) {
'include ::apt'
@@ -18,23 +18,23 @@ describe 'unattended_upgrades' do
it {
should contain_apt__conf('unattended-upgrades').with(
- :require => 'Package[unattended-upgrades]',
- :notify_update => false,
+ require: 'Package[unattended-upgrades]',
+ notify_update: false,
)
}
it {
should contain_apt__conf('periodic').with(
- :require => 'Package[unattended-upgrades]',
- :notify_update => false,
+ require: 'Package[unattended-upgrades]',
+ notify_update: false,
)
}
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
/Unattended-Upgrade::Origins-Pattern {/
).with_content(
@@ -60,9 +60,9 @@ describe 'unattended_upgrades' do
it {
should create_file(file_periodic).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
@@ -91,23 +91,23 @@ describe 'unattended_upgrades' do
}
it { should contain_apt__conf('auto-upgrades').with(
- :ensure => 'absent',
+ ensure: 'absent',
)
}
end
context 'with defaults on Debian 6 Squeeze' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Debian',
- :lsbdistcodename => 'squeeze',
- :lsbdistrelease => '6.0.10',
+ osfamily: 'Debian',
+ lsbdistid: 'Debian',
+ lsbdistcodename: 'squeeze',
+ lsbdistrelease: '6.0.10',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -121,16 +121,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Debian 7 Wheezy' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Debian',
- :lsbdistcodename => 'wheezy',
- :lsbdistrelease => '7.1',
+ osfamily: 'Debian',
+ lsbdistid: 'Debian',
+ lsbdistcodename: 'wheezy',
+ lsbdistrelease: '7.1',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
@@ -143,16 +143,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Debian 8 Jessie' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Debian',
- :lsbdistcodename => 'jessie',
- :lsbdistrelease => '8.2',
+ osfamily: 'Debian',
+ lsbdistid: 'Debian',
+ lsbdistcodename: 'jessie',
+ lsbdistrelease: '8.2',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This section varies for different releases
/\Unattended-Upgrade::Origins-Pattern\ {\n
@@ -164,16 +164,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Ubuntu 12.04LTS Precise Pangolin' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Ubuntu',
- :lsbdistcodename => 'precise',
- :lsbrelease => '12.04',
+ osfamily: 'Debian',
+ lsbdistid: 'Ubuntu',
+ lsbdistcodename: 'precise',
+ lsbrelease: '12.04',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -185,16 +185,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Ubuntu 14.04LTS Trusty Tahr' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Ubuntu',
- :lsbdistcodename => 'trusty',
- :lsbrelease => '14.04',
+ osfamily: 'Debian',
+ lsbdistid: 'Ubuntu',
+ lsbdistcodename: 'trusty',
+ lsbrelease: '14.04',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -206,16 +206,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Ubuntu 15.04 Vivid Vervet' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Ubuntu',
- :lsbdistcodename => 'vivid',
- :lsbrelease => '15.04',
+ osfamily: 'Debian',
+ lsbdistid: 'Ubuntu',
+ lsbdistcodename: 'vivid',
+ lsbrelease: '15.04',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -227,16 +227,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Ubuntu 15.10 Wily Werewolf' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Ubuntu',
- :lsbdistcodename => 'wily',
- :lsbrelease => '15.10',
+ osfamily: 'Debian',
+ lsbdistid: 'Ubuntu',
+ lsbdistcodename: 'wily',
+ lsbrelease: '15.10',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
# This is the only section that's different for Ubuntu compared to Debian
/\Unattended-Upgrade::Allowed-Origins\ {\n
@@ -248,16 +248,16 @@ describe 'unattended_upgrades' do
context 'with defaults on Raspbian' do
let(:facts) { {
- :osfamily => 'Debian',
- :lsbdistid => 'Raspbian',
- :lsbdistcodename => 'jessie',
- :lsbrelease => '8.0',
+ osfamily: 'Debian',
+ lsbdistid: 'Raspbian',
+ lsbdistcodename: 'jessie',
+ lsbrelease: '8.0',
} }
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
)
}
end
@@ -265,54 +265,54 @@ describe 'unattended_upgrades' do
context 'set all the things' do
let :params do
{
- :age => { 'min' => 1, 'max' => 20 },
- :size => 1000,
- :update => 5,
- :upgradeable_packages => {
+ age: { 'min' => 1, 'max' => 20 },
+ size: 1000,
+ update: 5,
+ upgradeable_packages: {
'download_only' => 5,
'debdelta' => 5,
},
- :upgrade => 5,
- :auto => {
+ upgrade: 5,
+ auto: {
'clean' => '5',
'fix_interrupted_dpkg' => false,
'remove' => false,
'reboot' => true,
},
- :verbose => 1,
- :legacy_origin => true,
- :origins => %w(bananas),
- :blacklist => %w(foo bar),
- :minimal_steps => false,
- :install_on_shutdown => true,
- :mail => {
+ verbose: 1,
+ legacy_origin: true,
+ origins: %w(bananas),
+ blacklist: %w(foo bar),
+ minimal_steps: false,
+ install_on_shutdown: true,
+ mail: {
'to' => 'root@localhost',
'only_on_error' => true,
},
- :dl_limit => 70,
- :random_sleep => 300,
- :notify_update => true,
+ dl_limit: 70,
+ random_sleep: 300,
+ notify_update: true,
}
end
it { should contain_package('unattended-upgrades') }
it { should contain_apt__conf('unattended-upgrades').with(
- :require => 'Package[unattended-upgrades]',
- :notify_update => true,
+ require: 'Package[unattended-upgrades]',
+ notify_update: true,
)
}
it { should contain_apt__conf('periodic').with(
- :require => 'Package[unattended-upgrades]',
- :notify_update => true,
+ require: 'Package[unattended-upgrades]',
+ notify_update: true,
)
}
it {
should create_file(file_unattended).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
/Unattended-Upgrade::Allowed-Origins {\n\t"bananas";\n};/
).with_content(
@@ -338,9 +338,9 @@ describe 'unattended_upgrades' do
it {
should create_file(file_periodic).with(
- :owner => 'root',
- :group => 'root',
- :mode => '0644',
+ owner: 'root',
+ group: 'root',
+ mode: '0644',
).with_content(
/APT::Periodic::Enable "1";/
).with_content(
@@ -372,7 +372,7 @@ describe 'unattended_upgrades' do
it {
should contain_apt__conf('auto-upgrades').with(
- :ensure => 'absent',
+ ensure: 'absent',
)
}
end
@@ -381,7 +381,7 @@ describe 'unattended_upgrades' do
context 'bad install_on_shutdown' do
let :params do
{
- :install_on_shutdown => 'foo',
+ install_on_shutdown: 'foo',
}
end
it do
@@ -393,7 +393,7 @@ describe 'unattended_upgrades' do
context 'bad legacy_origin' do
let :params do
{
- :legacy_origin => 'foo',
+ legacy_origin: 'foo',
}
end
it do
@@ -405,7 +405,7 @@ describe 'unattended_upgrades' do
context 'bad minimal_steps' do
let :params do
{
- :minimal_steps => 'foo',
+ minimal_steps: 'foo',
}
end
it do
@@ -417,7 +417,7 @@ describe 'unattended_upgrades' do
context 'bad blacklist' do
let :params do
{
- :blacklist => 'foo',
+ blacklist: 'foo',
}
end
it do
@@ -429,7 +429,7 @@ describe 'unattended_upgrades' do
context 'bad origins' do
let :params do
{
- :origins => 'foo',
+ origins: 'foo',
}
end
it do
@@ -441,7 +441,7 @@ describe 'unattended_upgrades' do
context 'bad auto' do
let :params do
{
- :auto => 'foo',
+ auto: 'foo',
}
end
it do
@@ -453,7 +453,7 @@ describe 'unattended_upgrades' do
context 'bad mail' do
let :params do
{
- :mail => 'foo',
+ mail: 'foo',
}
end
it do
@@ -465,7 +465,7 @@ describe 'unattended_upgrades' do
context 'bad backup' do
let :params do
{
- :backup => 'foo',
+ backup: 'foo',
}
end
it do
@@ -477,7 +477,7 @@ describe 'unattended_upgrades' do
context 'bad age' do
let :params do
{
- :age => 'foo',
+ age: 'foo',
}
end
it do
@@ -489,7 +489,7 @@ describe 'unattended_upgrades' do
context 'bad size' do
let :params do
{
- :size => 'foo',
+ size: 'foo',
}
end
it do
@@ -501,7 +501,7 @@ describe 'unattended_upgrades' do
context 'bad upgradeable_packages' do
let :params do
{
- :upgradeable_packages => 'foo',
+ upgradeable_packages: 'foo',
}
end
it do
@@ -513,7 +513,7 @@ describe 'unattended_upgrades' do
context 'bad mail[\'only_on_error\']' do
let :params do
{
- :mail => { 'only_on_error' => 'foo' },
+ mail: { 'only_on_error' => 'foo' },
}
end
it do
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2c6f566..1ffdf17 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1 +1,3 @@
require 'puppetlabs_spec_helper/module_spec_helper'
+require 'rspec-puppet-facts'
+include RspecPuppetFacts