spec/fog/bouncer/group_spec.rb in fog-bouncer-0.2.4 vs spec/fog/bouncer/group_spec.rb in fog-bouncer-0.2.5
- old
+ new
@@ -27,9 +27,18 @@
it "should not create duplicate sources" do
@group.sources.select { |s| s.source == "0.0.0.0/0" }.size.must_equal 1
end
end
+ describe "#exceeded?" do
+ it "should check if the group exceeds the AWS rules limit" do
+ @group.exceeded?.must_equal false
+ source = @group.sources.first
+ 0.upto(100) { |i| p = source.add_protocol(:tcp, i + 1000); p.local = true }
+ @group.exceeded?.must_equal true
+ end
+ end
+
describe "#extras" do
before do
Fog::Bouncer::IPPermissions.to(@group, [{ "ipProtocol" => "tcp", "fromPort" => 20, "toPort" => 20, "ipRanges" => [{ "cidrIp" => "2.2.2.2/2" }], "groups" => [] }])
@doorlist.clear_remote