Replace expect..should with expect..to
This commit is contained in:
parent
1c10f67a37
commit
eef6b12f44
@ -4,9 +4,7 @@ describe 'swift::proxy' do
|
|||||||
|
|
||||||
describe 'without memcached being included' do
|
describe 'without memcached being included' do
|
||||||
it 'should raise an error' do
|
it 'should raise an error' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,9 +31,7 @@ describe 'swift::proxy' do
|
|||||||
|
|
||||||
describe 'without the proxy local network ip address being specified' do
|
describe 'without the proxy local network ip address being specified' do
|
||||||
it "should fail" do
|
it "should fail" do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /Must pass proxy_local_net_ip/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /Must pass proxy_local_net_ip/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -121,9 +117,7 @@ describe 'swift::proxy' do
|
|||||||
[:account_autocreate, :allow_account_management].each do |param|
|
[:account_autocreate, :allow_account_management].each do |param|
|
||||||
it "should fail when #{param} is not passed a boolean" do
|
it "should fail when #{param} is not passed a boolean" do
|
||||||
params[param] = 'false'
|
params[param] = 'false'
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /is not a boolean/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /is not a boolean/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -11,9 +11,7 @@ describe 'swift::ringbuilder' do
|
|||||||
end
|
end
|
||||||
describe 'when swift class is not included' do
|
describe 'when swift class is not included' do
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe 'when swift class is included' do
|
describe 'when swift class is included' do
|
||||||
|
@ -22,9 +22,7 @@ describe 'swift' do
|
|||||||
{}
|
{}
|
||||||
end
|
end
|
||||||
it 'should raise an exception' do
|
it 'should raise an exception' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -33,9 +31,7 @@ describe 'swift' do
|
|||||||
''
|
''
|
||||||
end
|
end
|
||||||
it 'should should raise an exception' do
|
it 'should should raise an exception' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,9 +29,7 @@ describe 'swift::storage::all' do
|
|||||||
|
|
||||||
describe 'when an internal network ip is not specified' do
|
describe 'when an internal network ip is not specified' do
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,15 +33,13 @@ describe 'swift::storage' do
|
|||||||
end
|
end
|
||||||
describe 'when local net ip is not specified' do
|
describe 'when local net ip is not specified' do
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe 'when the dependencies are not specified' do
|
describe 'when the dependencies are not specified' do
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect { subject }.should raise_error(Puppet::Error)
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -44,9 +44,7 @@ describe 'swift::ringbuilder::create' do
|
|||||||
'invalid'
|
'invalid'
|
||||||
end
|
end
|
||||||
it 'should raise an error' do
|
it 'should raise an error' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -19,9 +19,7 @@ describe 'swift::ringbuilder::rebalance' do
|
|||||||
'invalid'
|
'invalid'
|
||||||
end
|
end
|
||||||
it 'should raise an error' do
|
it 'should raise an error' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -29,9 +29,7 @@ describe 'swift::storage::generic' do
|
|||||||
'foo'
|
'foo'
|
||||||
end
|
end
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /does not match/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /does not match/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -32,9 +32,7 @@ describe 'swift::storage::server' do
|
|||||||
'foo'
|
'foo'
|
||||||
end
|
end
|
||||||
it 'should fail' do
|
it 'should fail' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /does not match/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /does not match/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -88,9 +86,7 @@ describe 'swift::storage::server' do
|
|||||||
describe "when pipeline is not passed an array" do
|
describe "when pipeline is not passed an array" do
|
||||||
let :params do req_params.merge({:pipeline => 'not an array'}) end
|
let :params do req_params.merge({:pipeline => 'not an array'}) end
|
||||||
it "should fail" do
|
it "should fail" do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error, /is not an Array/)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error, /is not an Array/)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
describe "when replicator_concurrency is set" do
|
describe "when replicator_concurrency is set" do
|
||||||
|
@ -5,9 +5,7 @@ describe 'swift::storage::xfs' do
|
|||||||
end
|
end
|
||||||
describe 'when a device is not specified' do
|
describe 'when a device is not specified' do
|
||||||
it 'should raise an error' do
|
it 'should raise an error' do
|
||||||
expect do
|
expect { subject }.to raise_error(Puppet::Error)
|
||||||
subject
|
|
||||||
end.should raise_error(Puppet::Error)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@ require 'puppet'
|
|||||||
describe Puppet::Type.type(:ring_account_device) do
|
describe Puppet::Type.type(:ring_account_device) do
|
||||||
|
|
||||||
it 'should fail if the name has no ":"' do
|
it 'should fail if the name has no ":"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
||||||
end.should raise_error(Puppet::Error, /should contain address:port\/device/)
|
}.to raise_error(Puppet::Error, /should contain address:port\/device/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should fail if the name does not contain a "/"' do
|
it 'should fail if the name does not contain a "/"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
||||||
end.should raise_error(Puppet::Error, /should contain a device/)
|
}.to raise_error(Puppet::Error, /should contain a device/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -3,14 +3,14 @@ require 'puppet'
|
|||||||
describe Puppet::Type.type(:ring_container_device) do
|
describe Puppet::Type.type(:ring_container_device) do
|
||||||
|
|
||||||
it 'should fail if the name has no ":"' do
|
it 'should fail if the name has no ":"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
||||||
end.should raise_error(Puppet::Error, /should contain address:port\/device/)
|
}.to raise_error(Puppet::Error, /should contain address:port\/device/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should fail if the name does not contain a "/"' do
|
it 'should fail if the name does not contain a "/"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
||||||
end.should raise_error(Puppet::Error, /should contain a device/)
|
}.to raise_error(Puppet::Error, /should contain a device/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2,14 +2,14 @@ require 'puppet'
|
|||||||
describe Puppet::Type.type(:ring_object_device) do
|
describe Puppet::Type.type(:ring_object_device) do
|
||||||
|
|
||||||
it 'should fail if the name has no ":"' do
|
it 'should fail if the name has no ":"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo/bar')
|
||||||
end.should raise_error(Puppet::Error, /should contain address:port\/device/)
|
}.to raise_error(Puppet::Error, /should contain address:port\/device/)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should fail if the name does not contain a "/"' do
|
it 'should fail if the name does not contain a "/"' do
|
||||||
expect do
|
expect {
|
||||||
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
Puppet::Type.type(:ring_account_device).new(:name => 'foo:80')
|
||||||
end.should raise_error(Puppet::Error, /should contain a device/)
|
}.to raise_error(Puppet::Error, /should contain a device/)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user