 
 lib = if process.env.MECANO_COV then 'lib-cov' else 'lib'
 mecano = require "../#{lib}"
+they = require 'ssh2-they'
 test = require './test'
 
 describe 'extract', ->
 
   scratch = test.scratch @
 
-  it 'should see extension .tgz', (next) ->
+  they 'should see extension .tgz', (ssh, next) ->
     # Test a non existing extracted dir
     mecano.extract
+      ssh: ssh
       source: "#{__dirname}/../resources/a_dir.tgz"
       destination: scratch
     , (err, extracted) ->

      # Note, there is no way for us to know which directory
      # it is in advance
      mecano.extract
        source: "#{__dirname}/../resources/a_dir.zip"
        destination: scratch
      , (err, extracted) ->
        return next err if err
        extracted.should.be.ok
        next()

  it 'should work accross ssh', (next) ->
    # Test a non existing extracted dir
    mecano.extract
      ssh: host: 'localhost'
      source: "#{__dirname}/../resources/a_dir.tgz"
      destination: scratch
    , (err, extracted) ->
      return next err if err
      extracted.should.be.ok
      next()
  
  it 'should validate a created file', (next) ->
    # Test with invalid creates option
    mecano.extract
      source: "#{__dirname}/../resources/a_dir.tgz"
      destination: scratch
      creates: "#{scratch}/oh_no"

        extracted.should.be.ok
        next()
  
  they 'should see extension .zip', (ssh, next) ->
    # Test a non existing extracted dir
    mecano.extract
      ssh: ssh
      source: "#{__dirname}/../resources/a_dir.zip"
      destination: scratch
    , (err, extracted) ->
