Skip to content

Commit

Permalink
Add a more complex spec that ties the various mixins together
Browse files Browse the repository at this point in the history
  • Loading branch information
rodjek committed Jun 4, 2011
1 parent e2b681d commit 7154612
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions spec/iptables/complex_spec.rb
@@ -0,0 +1,24 @@
require 'spec_helper'

describe IPTables::Rule do
context "when creating complex rules" do
describe "like allow traffic in on eth1 from 10.0.0.0/24 on port 443 with a new state" do
subject do
rule = IPTables::Rule.new
rule.chain = :input
rule.target = :accept
rule.protocol = :tcp
rule.source = '10.0.0.0/24'
rule.destination_port = 443
rule.add_module 'state'
rule.state = :new
rule.in_interface = 'eth1'
rule
end

its(:to_iptables) {
should == '-A INPUT -i eth1 -s 10.0.0.0/24 -p tcp --dport 443 -m state --state NEW -j ACCEPT'
}
end
end
end

0 comments on commit 7154612

Please sign in to comment.