determine if instances are InService across a given load balancer and array of load balancers
This commit is contained in:
11
spec/support/fake_ec2.rb
Normal file
11
spec/support/fake_ec2.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module AWS
|
||||
class FakeEC2
|
||||
def initialize
|
||||
end
|
||||
|
||||
class Instance
|
||||
def initialize
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
37
spec/support/fake_elb.rb
Normal file
37
spec/support/fake_elb.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
module AWS
|
||||
class FakeELB
|
||||
def initialize
|
||||
end
|
||||
|
||||
class LoadBalancer
|
||||
def initialize(name, options = {})
|
||||
end
|
||||
|
||||
def instances
|
||||
@instances ||= InstanceCollection.new
|
||||
end
|
||||
end
|
||||
|
||||
class InstanceCollection
|
||||
def initialize
|
||||
end
|
||||
|
||||
def health
|
||||
@health ||= [
|
||||
{
|
||||
instance: AWS::FakeEC2::Instance.new,
|
||||
description: 'N/A',
|
||||
state: 'InService',
|
||||
reason_code: 'N/A'
|
||||
},
|
||||
{
|
||||
instance: AWS::FakeEC2::Instance.new,
|
||||
description: 'Instance has failed at least the UnhealthyThreshold number of health checks consecutively.',
|
||||
state: 'OutOfService',
|
||||
reason_code: 'Instance'
|
||||
}
|
||||
]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user