Files
puppet-swift/spec/defines/swift_ringbuilder_rebalance_spec.rb
Dan Bode 4775be3a5f Add rspec-puppet test coverage
This commit adds test coverage for almost all
swift classes and defines.

It does not quite add 100% coverage (probably
more like 85%)
2012-02-26 20:52:27 -08:00

29 lines
711 B
Ruby

require 'spec_helper'
describe 'swift::ringbuilder::rebalance' do
describe 'with allowed titles' do
['object', 'container', 'account'].each do |type|
describe "when title is #{type}" do
let :title do
type
end
it { should contain_exec("rebalance_#{type}").with(
{:command => "swift-ring-builder /etc/swift/#{type}.builder rebalance",
:path => ['/usr/bin'],
:refreshonly => true}
)}
end
end
end
describe 'with an invalid title' do
let :title do
'invalid'
end
it 'should raise an error' do
expect do
subject
end.should raise_error(Puppet::Error)
end
end
end