diff --git a/spec/classes/newrelic_infra_spec.rb b/spec/classes/newrelic_infra_spec.rb index 74a296c..5de4d4a 100644 --- a/spec/classes/newrelic_infra_spec.rb +++ b/spec/classes/newrelic_infra_spec.rb @@ -1,37 +1,34 @@ require 'spec_helper' -describe 'newrelic::infra', :type => :class do - +describe 'newrelic::infra', 'type' => 'class' do let(:facts) do - { - 'os' => { - 'family' => 'RedHat', - 'name' => 'CentOS', - 'release' => { - 'major' => '7' - } + { + 'os' => { + 'family' => 'RedHat', + 'name' => 'CentOS', + 'release' => { + 'major' => '7', + }, + }, } - } end - let(:params) do - { - :license_key => '1234567890qwerty', - } + { + 'license_key' => '1234567890qwerty', + } end - it { is_expected.to compile } - it { should contain_package('newrelic-infra') } - it { should contain_service('newrelic-infra').that_requires('Package[newrelic-infra]') } - it { should contain_file('/etc/newrelic-infra.yml').with_content("license_key: 1234567890qwerty\n") } + it { is_expected.to contain_package('newrelic-infra') } + it { is_expected.to contain_service('newrelic-infra').that_requires('Package[newrelic-infra]') } + it { is_expected.to contain_file('/etc/newrelic-infra.yml').with_content("license_key: 1234567890qwerty\n") } context 'with manage_repo => true' do - let(:params)do - super().merge({ 'manage_repo' => true }) + let(:params) do + super().merge('manage_repo' => true) end - it { should contain_class('newrelic::repo::infra') } + it { is_expected.to contain_class('newrelic::repo::infra') } end end diff --git a/spec/classes/newrelic_java_spec.rb b/spec/classes/newrelic_java_spec.rb index a817a9a..0bad34b 100644 --- a/spec/classes/newrelic_java_spec.rb +++ b/spec/classes/newrelic_java_spec.rb @@ -1,31 +1,31 @@ require 'spec_helper' -describe 'newrelic::agent::java', :type => :class do - let(:facts) do +describe 'newrelic::agent::java', type: :class do + let(:facts) do { 'os' => { 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } + 'major' => '7', + }, }, 'operatingsystem' => 'Centos', - 'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin' - } + 'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin', + } end let(:params) do { - :license_key => '1234567890qwerty', - :manage_config => true + license_key: '1234567890qwerty', + manage_config: true, } end it { is_expected.to compile } - it { should contain_package('unzip') } - it { should contain_exec('wget-newrelic-java-agent')} - it { should contain_exec('chown-newrelic-install-dir')} - it { should contain_exec('unzip-newrelic-java-agent-zip')} - it { should contain_file('/opt/newrelic/newrelic.yml')} + it { is_expected.to contain_package('unzip') } + it { is_expected.to contain_exec('wget-newrelic-java-agent') } + it { is_expected.to contain_exec('chown-newrelic-install-dir') } + it { is_expected.to contain_exec('unzip-newrelic-java-agent-zip') } + it { is_expected.to contain_file('/opt/newrelic/newrelic.yml') } end diff --git a/spec/classes/newrelic_php_spec.rb b/spec/classes/newrelic_php_spec.rb index a532557..590cd2f 100644 --- a/spec/classes/newrelic_php_spec.rb +++ b/spec/classes/newrelic_php_spec.rb @@ -1,42 +1,42 @@ require 'spec_helper' -describe 'newrelic::agent::php', :type => :class do - let(:facts) do +describe 'newrelic::agent::php', type: :class do + let(:facts) do { 'os' => { 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } + 'major' => '7', + }, }, 'operatingsystem' => 'Centos', - 'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin' - } + 'path' => '/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin:/root/.local/bin:/root/bin', + } end let(:params) do { - :license_key => '1234567890qwerty', - :conf_dir => '/opt/rh/php54/root/etc/php.d', + license_key: '1234567890qwerty', + conf_dir: '/opt/rh/php54/root/etc/php.d', } end it { is_expected.to compile } - it { should contain_class('newrelic::params') } - it { should contain_class('newrelic::repo::legacy') } - it { should contain_package('newrelic-php5') } - it { should contain_package('php-cli') } - it { should contain_file('/etc/newrelic/newrelic.cfg') } - it { should contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } - it { should contain_exec('newrelic install') } - it { should contain_exec('newrelic_kill') } - + it { is_expected.to contain_class('newrelic::params') } + it { is_expected.to contain_class('newrelic::repo::legacy') } + it { is_expected.to contain_package('newrelic-php5') } + it { is_expected.to contain_package('php-cli') } + it { is_expected.to contain_file('/etc/newrelic/newrelic.cfg') } + it { is_expected.to contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } + it { is_expected.to contain_exec('newrelic install') } + it { is_expected.to contain_exec('newrelic_kill') } context 'startup_mode => external' do let(:params) do - super().merge({ 'startup_mode' => 'external' }) + super().merge('startup_mode' => 'external') end - it { should contain_service('newrelic-daemon') } + + it { is_expected.to contain_service('newrelic-daemon') } end end diff --git a/spec/classes/newrelic_repo_infra_spec.rb b/spec/classes/newrelic_repo_infra_spec.rb index 167f285..1e125cf 100644 --- a/spec/classes/newrelic_repo_infra_spec.rb +++ b/spec/classes/newrelic_repo_infra_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -describe 'newrelic::repo::infra', :type => :class do - +describe 'newrelic::repo::infra', type: :class do context 'OS Family => RedHat' do let(:facts) do { @@ -9,14 +8,14 @@ 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } - } - } - end + 'major' => '7', + }, + }, + } + end it { is_expected.to compile } - it { should contain_yumrepo('newrelic-infra') } + it { is_expected.to contain_yumrepo('newrelic-infra') } end context 'OS Family => Debian' do @@ -25,19 +24,17 @@ 'lsbdistcodename' => 'wheezy', 'osfamily' => 'Debian', 'os' => { - 'family' => 'Debian', - 'name' => 'Debian', - 'release' => { - 'full' => '7.0' - } + 'family' => 'Debian', + 'name' => 'Debian', + 'release' => { + 'full' => '7.0', + }, }, - } - end + } + end it { is_expected.to compile } - it { should contain_apt__source('newrelic-infra') } - it { should contain_package('apt-transport-https') } + it { is_expected.to contain_apt__source('newrelic-infra') } + it { is_expected.to contain_package('apt-transport-https') } end - - end diff --git a/spec/classes/newrelic_repo_legacy_spec.rb b/spec/classes/newrelic_repo_legacy_spec.rb index fc8eac2..17cab3d 100644 --- a/spec/classes/newrelic_repo_legacy_spec.rb +++ b/spec/classes/newrelic_repo_legacy_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' -describe 'newrelic::repo::legacy', :type => :class do - +describe 'newrelic::repo::legacy', type: :class do context 'OS Family => Redhat' do let(:facts) do { @@ -9,33 +8,32 @@ 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } - } + 'major' => '7', + }, + }, } end it { is_expected.to compile } - it { should contain_package('newrelic-repo-5-3.noarch') } + it { is_expected.to contain_package('newrelic-repo-5-3.noarch') } end context 'OS Family => Debian' do let(:facts) do { 'os' => { - 'family' => 'Debian', - 'name' => 'Debian', - 'release' => { - 'full' => '7.0' - } + 'family' => 'Debian', + 'name' => 'Debian', + 'release' => { + 'full' => '7.0', + }, }, 'osfamily' => 'Debian', - 'lsbdistcodename' => 'wheezy' - } - end + 'lsbdistcodename' => 'wheezy', + } + end it { is_expected.to compile } - it { should contain_apt__source('newrelic') } + it { is_expected.to contain_apt__source('newrelic') } end - end diff --git a/spec/classes/newrelic_server_linux_spec.rb b/spec/classes/newrelic_server_linux_spec.rb index e163cde..074e53b 100644 --- a/spec/classes/newrelic_server_linux_spec.rb +++ b/spec/classes/newrelic_server_linux_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe 'newrelic::server::linux', :type => :class do +describe 'newrelic::server::linux', type: :class do let(:facts) do { 'path' => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/puppetlabs/bin:/snap/bin:/opt/puppetlabs/bin/', @@ -8,33 +8,31 @@ 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } - } - } + 'major' => '7', + }, + }, + } end let(:params) do { - :license_key => '1234567890qwerty', + license_key: '1234567890qwerty', } end it { is_expected.to compile } - it { should contain_class('newrelic::repo::legacy') } - it { should contain_service('newrelic-sysmond') } - it { should contain_package('newrelic-sysmond') } - it { should contain_file('/var/log/newrelic') } - it { should contain_file('/etc/newrelic/nrsysmond.cfg') } - it { should contain_exec('install_newrelic_license_key') } + it { is_expected.to contain_class('newrelic::repo::legacy') } + it { is_expected.to contain_service('newrelic-sysmond') } + it { is_expected.to contain_package('newrelic-sysmond') } + it { is_expected.to contain_file('/var/log/newrelic') } + it { is_expected.to contain_file('/etc/newrelic/nrsysmond.cfg') } + it { is_expected.to contain_exec('install_newrelic_license_key') } context 'with manage_repo => true' do - let(:params)do - super().merge({ 'manage_repo' => true }) + let(:params) do + super().merge('manage_repo' => true) end - it { should contain_class('newrelic::repo::legacy') } + it { is_expected.to contain_class('newrelic::repo::legacy') } end - - end diff --git a/spec/classes/newrelic_spec.rb b/spec/classes/newrelic_spec.rb index 5647f08..0c443bc 100644 --- a/spec/classes/newrelic_spec.rb +++ b/spec/classes/newrelic_spec.rb @@ -1,25 +1,24 @@ require 'spec_helper' -describe 'newrelic', :type => :class do +describe 'newrelic', type: :class do let(:facts) do { 'os' => { 'family' => 'RedHat', 'name' => 'CentOS', 'release' => { - 'major' => '7' - } - } - } + 'major' => '7', + }, + }, + } end let(:params) do - { - :license_key => '1234567890qwerty', - } + { + license_key: '1234567890qwerty', + } end it { is_expected.to compile } - it { should contain_class('newrelic::params') } - + it { is_expected.to contain_class('newrelic::params') } end diff --git a/spec/defines/newrelic_ini.rb b/spec/defines/newrelic_ini.rb index f39fa60..fc4201b 100644 --- a/spec/defines/newrelic_ini.rb +++ b/spec/defines/newrelic_ini.rb @@ -4,8 +4,7 @@ let(:title) { '/opt/rh/php54/root/etc/php.d' } it { is_expected.to compile } - it { should contain_defines__newrelic__php__newrelic_ini('/opt/rh/php54/root/etc/php.d') } - it { should contain_exec('/usr/bin/newrelic-install /opt/rh/php54/root/etc/php.d') } - it { should contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } - + it { is_expected.to contain_defines__newrelic__php__newrelic_ini('/opt/rh/php54/root/etc/php.d') } + it { is_expected.to contain_exec('/usr/bin/newrelic-install /opt/rh/php54/root/etc/php.d') } + it { is_expected.to contain_file('/opt/rh/php54/root/etc/php.d/newrelic.ini') } end