1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/helpers/compute/volume_helper.rb

23 lines
509 B
Ruby
Raw Normal View History

2012-05-22 19:52:17 -04:00
def volume_tests(connection, params = {}, mocks_implemented = true)
model_tests(connection.volumes, params[:volume_attributes], mocks_implemented) do
if !Fog.mocking? || mocks_implemented
@instance.wait_for { ready? }
end
@server = connection.servers.create(params[:server_attributes])
@server.wait_for { ready? }
tests('attach').succeeds do
@instance.attach(@server)
end
tests('detach').succeeds do
@instance.detach
end
@server.destroy
end
end