From: Jonathan Boyett Date: Wed, 15 Jun 2011 20:42:49 +0000 (-0700) Subject: add type tests X-Git-Tag: v0.0.1~47 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b89903f21616d7f9a16039de7ebbe298aafef07e;p=puppet-modules%2Fpuppetlabs-firewall.git add type tests --- diff --git a/spec/type/iptables_type_spec.rb b/spec/type/iptables_type_spec.rb new file mode 100644 index 0000000..e7254db --- /dev/null +++ b/spec/type/iptables_type_spec.rb @@ -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