[ninefold|compute] mark before/after blocks as pending in mocked mode also

This commit is contained in:
geemus 2012-09-28 09:59:49 -05:00
parent 1afde1548a
commit 22f2b652f5
1 changed files with 15 additions and 9 deletions

View File

@ -5,17 +5,21 @@ Shindo.tests('Fog::Compute[:ninefold] | load balancers', ['ninefold']) do
before do before do
@compute = Fog::Compute[:ninefold] @compute = Fog::Compute[:ninefold]
unless Fog.mocking?
@public_ip_id = @compute.list_public_ip_addresses.first['id'] @public_ip_id = @compute.list_public_ip_addresses.first['id']
@server_id = @compute.servers.all.first.id @server_id = @compute.servers.all.first.id
@create_load_balancer = @compute.create_load_balancer_rule(:algorithm => 'roundrobin', :name => 'test', @create_load_balancer = @compute.create_load_balancer_rule(:algorithm => 'roundrobin', :name => 'test',
:privateport => 1000, :publicport => 2000, :privateport => 1000, :publicport => 2000,
:publicipid => @public_ip_id) :publicipid => @public_ip_id)
end end
end
after do after do
unless Fog.mocking?
delete = @compute.delete_load_balancer_ruler(:id => @create_load_balancer['id']) delete = @compute.delete_load_balancer_ruler(:id => @create_load_balancer['id'])
Ninefold::Compute::TestSupport.wait_for_job(delete['jobid']) Ninefold::Compute::TestSupport.wait_for_job(delete['jobid'])
end end
end
tests("#create_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::CREATE_LOAD_BALANCER_RULE_RESPONSE) do tests("#create_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::CREATE_LOAD_BALANCER_RULE_RESPONSE) do
pending if Fog.mocking? pending if Fog.mocking?
@ -45,9 +49,11 @@ Shindo.tests('Fog::Compute[:ninefold] | load balancers', ['ninefold']) do
tests('with assigned to load balancer rule') do tests('with assigned to load balancer rule') do
before do before do
unless Fog.mocking?
assign_load_balancer = @compute.assign_to_load_balancer_rule(:id => @create_load_balancer['id'], :virtualmachineids => @server_id) assign_load_balancer = @compute.assign_to_load_balancer_rule(:id => @create_load_balancer['id'], :virtualmachineids => @server_id)
result = Ninefold::Compute::TestSupport.wait_for_job(assign_load_balancer['jobid']) result = Ninefold::Compute::TestSupport.wait_for_job(assign_load_balancer['jobid'])
end end
end
tests("#remove_from_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE) do tests("#remove_from_load_balancer_rule()").formats(Ninefold::Compute::Formats::LoadBalancers::REMOVE_FROM_LOAD_BALANCER_RULE_RESPONSE) do
pending if Fog.mocking? pending if Fog.mocking?