a72e27f83c
Currently we specify the ordering of config resources wherever it is necessary based on the presence of the file it will write to, or the presence of the package in charge of providing the file it will write to. Those kind of ordering can be specified directly at the resource level using the autorequire mechanism. With this patch, any config resource will make sure the package in charge of providing the file will be installed first. Change-Id: Icb3464cc0a747d40326d610d38806d059c9a0fc3
20 lines
677 B
Ruby
20 lines
677 B
Ruby
require 'puppet'
|
|
require 'puppet/type/swift_bench_config'
|
|
|
|
describe 'Puppet::Type.type(:swift_bench_config)' do
|
|
before :each do
|
|
@swift_bench_config = Puppet::Type.type(:swift_bench_config).new(:name => 'DEFAULT/foo', :value => 'bar')
|
|
end
|
|
|
|
it 'should autorequire the package that install the file' do
|
|
catalog = Puppet::Resource::Catalog.new
|
|
package = Puppet::Type.type(:package).new(:name => 'swift')
|
|
catalog.add_resource package, @swift_bench_config
|
|
dependency = @swift_bench_config.autorequire
|
|
expect(dependency.size).to eq(1)
|
|
expect(dependency[0].target).to eq(@swift_bench_config)
|
|
expect(dependency[0].source).to eq(package)
|
|
end
|
|
|
|
end
|