/*!
 * always-thunk <https://github.com/tunnckoCore/always-thunk>
 *
 * Copyright (c) 2015 Charlike Mike Reagent <@tunnckoCore> (http://www.tunnckocore.tk)
 * Released under the MIT license.
 */

/* jshint asi:true */

'use strict'

var fs = require('fs')
var test = require('assertit')
var alwaysThunk = require('./index')

// test('always-thunk:', function () {
//   // body
// })

var readFileSync = alwaysThunk(fs.readFileSync)
readFileSync('./package.json', 'utf8')(console.log)

var readFile = alwaysThunk(fs.readFile)
readFile('./package.json', 'utf8')(console.log)

@@ -318,19 +318,16 @@
 ndex')%0A%0A
-// 
 test('al
@@ -358,28 +358,324 @@
 ) %7B%0A
-//   // body%0A// %7D)%0A%0A
+  test('should throw TypeError if not a function given', function (done) %7B%0A    function fixture () %7B%0A      alwaysThunk(12345)%0A    %7D%0A%0A    test.throws(fixture, TypeError)%0A    test.throws(fixture, /always-thunk expect a function/)%0A    done()%0A  %7D)%0A  test('should transform sync function to thunk', function (done) %7B%0A    
 var 
@@ -718,16 +718,20 @@
 leSync)%0A
+    
 readFile
@@ -765,22 +765,221 @@
 8')(
-console.log)%0A%0A
+function (err, res) %7B%0A      test.ifError(err)%0A      test.ok(res.indexOf('tunnckoCore/always-thunk') !== -1)%0A      done()%0A    %7D)%0A  %7D)%0A  test('should transform asynchronous function to thunk', function (done) %7B%0A    
 var 
@@ -1014,16 +1014,20 @@
 adFile)%0A
+    
 readFile
@@ -1057,17 +1057,140 @@
 8')(
-console.log
+function (err, res) %7B%0A      test.ifError(err)%0A      test.ok(res.indexOf('tunnckoCore/always-thunk') !== -1)%0A      done()%0A    %7D)%0A  %7D)%0A%7D
 )%0A

implement tests