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/server_helper.rb

26 lines
618 B
Ruby
Raw Normal View History

2010-11-12 02:01:18 -05:00
def server_tests(connection, params = {}, mocks_implemented = true)
model_tests(connection.servers, params, mocks_implemented) do
tests('#reload').returns(true) do
pending if Fog.mocking? && !mocks_implemented
identity = @instance.identity
!identity.nil? && identity == @instance.reload.identity
end
2010-11-12 02:01:18 -05:00
responds_to([:ready?, :state])
tests('#reboot').succeeds do
2010-11-16 14:47:05 -05:00
pending if Fog.mocking? && !mocks_implemented
2010-11-12 02:01:18 -05:00
@instance.wait_for { ready? }
@instance.reboot
end
2010-11-16 14:47:05 -05:00
if !Fog.mocking? || mocks_implemented
@instance.wait_for { ready? }
end
2010-11-12 02:01:18 -05:00
end
end