var assert = require( 'assert' )
var DKIM = require( '..' )

describe( 'DKIM', function() {

  describe( '.getKey()', function() {

    context( 'when key record exists', function() {

      it( 'should parse & return the key', function( done ) {
        DKIM.getKey( 'gmail.com', '20120113', function( error, key ) {
          assert.ifError( error )
          assert.equal( key instanceof DKIM.Key, true )
          assert.equal( key.type, 'rsa' )
          done()
        })
      })

    })

    context( 'when key record does not exist', function() {

      it( 'should PERMFAIL if domain has no record', function( done ) {
        DKIM.getKey( 'aa', function( error, key ) {
          assert.equal( key, null )
          assert.equal( error instanceof Error, true )
          assert.equal( error.code, DKIM.PERMFAIL )
          done()
        })
      })

      it( 'should PERMFAIL if TXT record is not a valid key', function( done ) {
        DKIM.getKey( 'gmail.com', function( error, key ) {
          assert.ok( key == null, 'key present' )
          assert.equal( error instanceof Error, true )
          assert.equal( error.code, DKIM.PERMFAIL )
          done()
        })
      })

      it( 'should TEMPFAIL if query fails to respond' )

    })

  })

})

@@ -189,23 +189,16 @@
    it( '
-should 
 parse & 
@@ -225,32 +225,32 @@
 ction( done ) %7B%0A
+
         DKIM.get
@@ -546,39 +546,32 @@
 ) %7B%0A%0A      it( '
-should 
 PERMFAIL if doma
@@ -852,23 +852,16 @@
    it( '
-should 
 PERMFAIL
@@ -1161,32 +1161,32 @@
    %7D)%0A      %7D)%0A%0A
+
       it( 'shoul
@@ -1184,15 +1184,8 @@
 t( '
-should 
 TEMP

Improve wording