Skip to content

Commit

Permalink
add a couples of spec tests to cover basic usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Hoblitt committed May 16, 2013
1 parent 56c987b commit bb34e2d
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions spec/classes/smartd_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
require 'spec_helper'

describe 'smartd' do
let(:title) { 'redhat' }
let(:facts) { {:osfamily=> 'RedHat', :lsbmajordistrelease => 6} }

context 'without params' do
it do
should include_class('smartd')
should include_class('smartd::params')
should contain_package('smartmontools')
should contain_service('smartd')
should contain_file('/etc/smartd.conf')\
.with_content(<<-END.gsub(/^\s+/, ""))
# Managed by Puppet -- do not edit!
DEFAULT -m root -M daily
DEVICESCAN
END
end
end

context 'without params + megaraid facts' do
let(:facts) do
{
:osfamily=> 'RedHat', :lsbmajordistrelease => 6,
:megaraid_adapters => '1',
:megaraid_virtual_drives => '/dev/sdb,/dev/sda',
:megaraid_physical_drives => '2,1',
}
end

it do
should include_class('smartd')
should include_class('smartd::params')
should contain_package('smartmontools')
should contain_service('smartd')
should contain_file('/etc/smartd.conf')\
.with_content(<<-END.gsub(/^\s+/, ""))
# Managed by Puppet -- do not edit!
DEFAULT -m root -M daily
/dev/sda -d sat+megaraid,1
/dev/sda -d sat+megaraid,2
DEVICESCAN
END
end
end
end

0 comments on commit bb34e2d

Please sign in to comment.