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
Josh Lane & Jason Hansen 42f2d81455 [compute] volume tests
2012-05-22 16:54:30 -07:00

22 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