Commit 1a56271b authored by Colin Shea's avatar Colin Shea

spf record type & helper

parent 30d34407
......@@ -189,6 +189,11 @@ class Zone
push :sshfp, name, ttl, key_type: key_type, fingerprint_type: fingerprint_type, fingerprint: fingerprint
end
def spf(text, ttl=nil)
push :spf, "@", ttl, text: text
push :txt, "@", ttl, text: text
end
protected
# evaluates a file
......
......@@ -178,4 +178,12 @@ describe Zone do
subject.zonefile.sshfp.must_equal [{:class=>"IN", :name=>"@", :ttl=>nil, :key_type=>3, :fingerprint_type=>1, :fingerprint=>"6ebd5d0a92eb1639ce59702da4afa29b8fa09a49"}]
end
end
describe "spf record" do
it "should create a spf record" do
subject.spf "v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"
subject.zonefile.spf.must_equal [{:class=>"IN", :name=>"@", :ttl=>nil, :text=>"v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"}]
subject.zonefile.txt.must_equal [{:class=>"IN", :name=>"@", :ttl=>nil, :text=>"v=spf1 include:_spf.google.com include:acmeemailmarketing.com ~all"}]
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment