mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
d2e06e96ca
pluralize service name use multi_json fix directory structure for consistency
24 lines
675 B
Ruby
24 lines
675 B
Ruby
module Shindo
|
|
class Tests
|
|
def given_a_load_balancer_service(&block)
|
|
@service = Fog::Rackspace::LoadBalancers.new
|
|
instance_eval(&block)
|
|
end
|
|
def given_a_load_balancer(&block)
|
|
@lb = @service.load_balancers.create({
|
|
:name => ('fog' + Time.now.to_i.to_s),
|
|
:protocol => 'HTTP',
|
|
:port => 80,
|
|
:virtual_ips => [{ :type => 'PUBLIC'}],
|
|
:nodes => [{ :address => '10.0.0.1', :port => 80, :condition => 'ENABLED'}]
|
|
})
|
|
@lb.wait_for { ready? }
|
|
begin
|
|
instance_eval(&block)
|
|
ensure
|
|
@lb.wait_for { ready? }
|
|
@lb.destroy
|
|
end
|
|
end
|
|
end
|
|
end
|