Replace expect..should with expect..to

This commit is contained in:
Branan Purvine-Riley 2012-07-12 15:24:03 -07:00
parent 1c10f67a37
commit eef6b12f44
13 changed files with 27 additions and 55 deletions

View File

@ -4,9 +4,7 @@ describe 'swift::proxy' do
describe 'without memcached being included' do
it 'should raise an error' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end
@ -33,9 +31,7 @@ describe 'swift::proxy' do
describe 'without the proxy local network ip address being specified' do
it "should fail" do
expect do
subject
end.should raise_error(Puppet::Error, /Must pass proxy_local_net_ip/)
expect { subject }.to raise_error(Puppet::Error, /Must pass proxy_local_net_ip/)
end
end
@ -121,9 +117,7 @@ describe 'swift::proxy' do
[:account_autocreate, :allow_account_management].each do |param|
it "should fail when #{param} is not passed a boolean" do
params[param] = 'false'
expect do
subject
end.should raise_error(Puppet::Error, /is not a boolean/)
expect { subject }.to raise_error(Puppet::Error, /is not a boolean/)
end
end
end

View File

@ -11,9 +11,7 @@ describe 'swift::ringbuilder' do
end
describe 'when swift class is not included' do
it 'should fail' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end
describe 'when swift class is included' do

View File

@ -22,9 +22,7 @@ describe 'swift' do
{}
end
it 'should raise an exception' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end
@ -33,9 +31,7 @@ describe 'swift' do
''
end
it 'should should raise an exception' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end

View File

@ -29,9 +29,7 @@ describe 'swift::storage::all' do
describe 'when an internal network ip is not specified' do
it 'should fail' do
expect do
subject
end.should raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
expect { subject }.to raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
end
end

View File

@ -33,15 +33,13 @@ describe 'swift::storage' do
end
describe 'when local net ip is not specified' do
it 'should fail' do
expect do
subject
end.should raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
expect { subject }.to raise_error(Puppet::Error, /Must pass storage_local_net_ip/)
end
end
end
describe 'when the dependencies are not specified' do
it 'should fail' do
expect { subject }.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end
end

View File

@ -44,9 +44,7 @@ describe 'swift::ringbuilder::create' do
'invalid'
end
it 'should raise an error' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end

View File

@ -19,9 +19,7 @@ describe 'swift::ringbuilder::rebalance' do
'invalid'
end
it 'should raise an error' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end

View File

@ -29,9 +29,7 @@ describe 'swift::storage::generic' do
'foo'
end
it 'should fail' do
expect do
subject
end.should raise_error(Puppet::Error, /does not match/)
expect { subject }.to raise_error(Puppet::Error, /does not match/)
end
end

View File

@ -32,9 +32,7 @@ describe 'swift::storage::server' do
'foo'
end
it 'should fail' do
expect do
subject
end.should raise_error(Puppet::Error, /does not match/)
expect { subject }.to raise_error(Puppet::Error, /does not match/)
end
end
@ -88,9 +86,7 @@ describe 'swift::storage::server' do
describe "when pipeline is not passed an array" do
let :params do req_params.merge({:pipeline => 'not an array'}) end
it "should fail" do
expect do
subject
end.should raise_error(Puppet::Error, /is not an Array/)
expect { subject }.to raise_error(Puppet::Error, /is not an Array/)
end
end
describe "when replicator_concurrency is set" do

View File

@ -5,9 +5,7 @@ describe 'swift::storage::xfs' do
end
describe 'when a device is not specified' do
it 'should raise an error' do
expect do
subject
end.should raise_error(Puppet::Error)
expect { subject }.to raise_error(Puppet::Error)
end
end

View File

@ -2,14 +2,14 @@ require 'puppet'
describe Puppet::Type.type(:ring_account_device) do
it 'should fail if the name has no ":"' do
expect do
expect {
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
it 'should fail if the name does not contain a "/"' do
expect do
expect {
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

View File

@ -3,14 +3,14 @@ require 'puppet'
describe Puppet::Type.type(:ring_container_device) do
it 'should fail if the name has no ":"' do
expect do
expect {
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
it 'should fail if the name does not contain a "/"' do
expect do
expect {
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

View File

@ -2,14 +2,14 @@ require 'puppet'
describe Puppet::Type.type(:ring_object_device) do
it 'should fail if the name has no ":"' do
expect do
expect {
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
it 'should fail if the name does not contain a "/"' do
expect do
expect {
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