fix up eventually calls

This commit is contained in:
Wesley Beary 2009-07-19 16:06:33 -07:00
parent f072170cd6
commit b21946f475
4 changed files with 11 additions and 5 deletions

View File

@ -8,7 +8,9 @@ describe 'EC2.create_snapshot' do
after(:all) do
ec2.delete_volume(@volume_id)
eventually { ec2.delete_snapshot(@snapshot_id) }
eventually do
ec2.delete_snapshot(@snapshot_id)
end
end
it "should return proper attributes" do

View File

@ -14,8 +14,10 @@ describe 'EC2.delete_snapshot' do
it "should return proper attributes" do
eventually do
actual = ec2.delete_snapshot(@snapshot_id)
actual.body[:request_id].should be_a(String)
[false, true].should include(actual.body[:return])
unless actual.body.empty?
actual.body[:request_id].should be_a(String)
[false, true].should include(actual.body[:return])
end
end
end

View File

@ -9,7 +9,9 @@ describe 'EC2.describe_snapshots' do
after(:all) do
ec2.delete_volume(@volume_id)
eventually { ec2.delete_snapshot(@snapshot_id) }
eventually do
ec2.delete_snapshot(@snapshot_id)
end
end
it "should return proper attributes with no params" do

View File

@ -45,7 +45,7 @@ def eventually(&block)
sleep(delay)
yield
break
rescue error => error
rescue => error
raise error if delay == 16
end
end