Permalink
Browse files

Move hSpec tests for 'lookupTXT' into the (tested) docs for 'lookupTXT'

  • Loading branch information...
1 parent ecaa45a commit e2af4345db7dbb3c96a47b0248df08454668a52e @orlitzky orlitzky committed Sep 12, 2013
Showing with 14 additions and 11 deletions.
  1. +14 −3 Network/DNS/Lookup.hs
  2. +0 −8 test2/LookupSpec.hs
View
@@ -290,9 +290,20 @@ lookupNSAuth = lookupNSImpl DNS.lookupAuth
----------------------------------------------------------------
-{-|
- Resolving 'String' by 'TXT'.
--}
+-- | Look up all \'TXT\' records for the given hostname. The results
+-- are free-form 'ByteString's.
+--
+-- Two common uses for \'TXT\' records are
+-- <http://en.wikipedia.org/wiki/Sender_Policy_Framework> and
+-- <http://en.wikipedia.org/wiki/DomainKeys_Identified_Mail>. As an
+-- example, we find the SPF record for \"mew.org\":
+--
+-- >>> let hostname = Data.ByteString.Char8.pack "mew.org"
+-- >>>
+-- >>> rs <- makeResolvSeed defaultResolvConf
+-- >>> withResolver rs $ \resolver -> lookupTXT resolver hostname
+-- Right ["v=spf1 +mx -all"]
+--
lookupTXT :: Resolver -> Domain -> IO (Either DNSError [ByteString])
lookupTXT rlv dom = do
erds <- DNS.lookup rlv dom TXT
View
@@ -17,14 +17,6 @@ spec = do
`shouldReturn`
Right []
- describe "lookupTXT" $ do
- it "gets TXT" $ do
- rs <- makeResolvSeed defaultResolvConf
- withResolver rs $ \resolver ->
- DNS.lookupTXT resolver "mew.org"
- `shouldReturn`
- Right ["v=spf1 +mx -all"]
-
describe "lookupPTR" $ do
it "gets PTR" $ do
rs <- makeResolvSeed defaultResolvConf

0 comments on commit e2af434

Please sign in to comment.