Skip to content

Commit

Permalink
basic spec for #8
Browse files Browse the repository at this point in the history
  • Loading branch information
deric committed Jan 16, 2015
1 parent 09ddbc8 commit e560be4
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require 'spec_helper'

describe 'zookeeper::repo', :type => :class do
shared_examples 'redhat-install' do |os, codename|
let(:cdhver){ 4 }
let(:hardwaremodel){ 'x86_64' }

let(:facts) {{
:operatingsystem => os,
:osfamily => 'RedHat',
:lsbdistcodename => codename,
:operatingsystemmajrelease => codename,
:hardwaremodel => hardwaremodel,
}}

it {
should contain_yumrepo("cloudera-cdh#{cdhver}").with({
'gpgkey' => "http://archive.cloudera.com/cdh#{cdhver}/redhat/#{codename}/#{hardwaremodel}/cdh/RPM-GPG-KEY-cloudera"
})
}
end

context 'on RedHat-like system' do
let(:user) { 'zookeeper' }
let(:group) { 'zookeeper' }

let(:params) { {
:source => 'cloudera',
} }

it_behaves_like 'redhat-install', 'RedHat', '6'
end
end

0 comments on commit e560be4

Please sign in to comment.