mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
23 lines
509 B
Ruby
23 lines
509 B
Ruby
|
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
|