puppet-glance/spec/classes/glance_backend_file_spec.rb
root 38622827fe This commit fixes spec test failures that were caused by
using RI's version of the concat module.

It introduces a custom fact concat_basedir that can determine
where the vardir is for a particular agent.

This commits adds that fact to unit tests that are validating
the resuling fragment files.
2012-05-08 14:38:55 -07:00

40 lines
1.1 KiB
Ruby

require 'spec_helper'
describe 'glance::backend::file' do
let :facts do
{
:concat_basedir => '/var/lib/puppet/concat',
:osfamily => 'Debian'
}
end
it 'should set the default store to file' do
verify_contents(
subject,
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/04_glance-api-backend',
['default_store = file']
)
end
it 'should configure file backend settings' do
verify_contents(
subject,
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-file',
['filesystem_store_datadir = /var/lib/glance/images/']
)
end
describe 'when datadir is overridden' do
let :params do
{
:filesystem_store_datadir => '/var/lib/glance/images2'
}
end
it 'should configure file backend settings with specified parameter' do
verify_contents(
subject,
'/var/lib/puppet/concat/_etc_glance_glance-api.conf/fragments/05_glance-api-file',
['filesystem_store_datadir = /var/lib/glance/images2']
)
end
end
end