Skip to content

Commit

Permalink
Fixing tests for other ruby versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tbielawa committed Jul 21, 2015
1 parent c59ff59 commit ffb56ba
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions spec/classes/collectd_plugin_openvpn_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe 'collectd::plugin::openvpn', :type => :class do

######################################################################
# Default param validation
# Default param validation, compilation succeeds

context ':ensure => present, default params' do
let :facts do
Expand All @@ -21,9 +21,6 @@
end
end

######################################################################
# Remaining parameter validation

context ':statusfile param is an array' do
let :facts do
{ :osfamily => 'RedHat',
Expand All @@ -44,6 +41,26 @@
end
end

######################################################################
# Remaining parameter validation, compilation fails

context ':statusfile is a string but not an absolute path' do
let :facts do
{ :osfamily => 'RedHat',
:collectd_version => '5.4',
}
end

let :params do
{:statusfile => 'megafrobber'}
end

it 'Will raise an error about :statusfile not being an absolute path' do
should compile.and_raise_error(/"megafrobber" is not an absolute path./)
end
end


context ':statusfile param is not a string or array' do
let :facts do
{ :osfamily => 'RedHat',
Expand All @@ -70,7 +87,7 @@
end

it 'Will raise an error about :improvednamingschema not being a boolean' do
should compile.and_raise_error(/Error while evaluating a Function Call, "true" is not a boolean./)
should compile.and_raise_error(/"true" is not a boolean. It looks to be a String/)
end
end

Expand All @@ -84,7 +101,7 @@
end

it 'Will raise an error about :collectcompression not being a boolean' do
should compile.and_raise_error(/Error while evaluating a Function Call, "true" is not a boolean./)
should compile.and_raise_error(/"true" is not a boolean. It looks to be a String/)
end
end

Expand All @@ -98,7 +115,7 @@
end

it 'Will raise an error about :collectindividualusers not being a boolean' do
should compile.and_raise_error(/Error while evaluating a Function Call, "true" is not a boolean./)
should compile.and_raise_error(/"true" is not a boolean. It looks to be a String/)
end
end

Expand All @@ -112,7 +129,7 @@
end

it 'Will raise an error about :collectusercount not being a boolean' do
should compile.and_raise_error(/Error while evaluating a Function Call, "true" is not a boolean./)
should compile.and_raise_error(/"true" is not a boolean. It looks to be a String/)
end
end

Expand Down

0 comments on commit ffb56ba

Please sign in to comment.