]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
add type tests
authorJonathan Boyett <jonathan@failingservers.com>
Wed, 15 Jun 2011 20:42:49 +0000 (13:42 -0700)
committerJonathan Boyett <jonathan@failingservers.com>
Wed, 15 Jun 2011 20:42:49 +0000 (13:42 -0700)
spec/type/iptables_type_spec.rb [new file with mode: 0644]

diff --git a/spec/type/iptables_type_spec.rb b/spec/type/iptables_type_spec.rb
new file mode 100644 (file)
index 0000000..e7254db
--- /dev/null
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe Puppet::Type.type(:firewall) do
+  before :each do
+    @resource = Puppet::Type.type(:firewall).new({
+      :name => 'new_resource',
+      :chain => 'INPUT',
+      :jump => 'ACCEPT'
+    })
+  end
+
+  it 'should accept a name' do
+    @resource[:name] = '000-test-foo'
+    @resource[:name].should == '000-test-foo'
+  end
+
+  it 'should accept a dport' do
+    @resource[:dport] = '22'
+    @resource[:dport].should == [22]
+  end
+end