 "use strict"
 importless = require '../src/importless'
-fs         = require 'fs'
+fs             = require 'fs'
+_              =  require('grunt').util._
 
 
 #

    next()
  'return files from "test" directory with trailing slash': (test) ->
    test.expect 1
    test.deepEqual importless.findAll("test/files/"), ['test/files/imported.less', 'test/files/test.less', 'test/files/test2.css']
    test.done()

exports['rename'] =

exports['getImported'] =
  'returns array of imported filepaths': (test) ->
    test.expect 1
    actual = _.sortBy importless.getImported(['test/files/test.less'])
    expected = _.sortBy ['test/files/whereever/someLessFile.less', 'test/files/imported.less', 'test/upperDir.less']
    test.deepEqual actual, expected
    test.done()

exports['stripImported'] =
  'return array without imported filepaths': (test) ->
    test.expect 1
    files = importless.findAll 'test/files'
    actual = _.sortBy importless.stripImported(files, importless.getImported(files))
    expected = _.sortBy ['test/files/test.less', 'test/files/test2.css']
    test.deepEqual actual, expected
    test.done()

exports['setIgnored'] =
  'ignore `ignore` directory when set': (test) ->
    test.expect 1
    importless.setIgnored '**/test2.*'
    files = importless.findAll 'test/files'
    actual = _.sortBy importless.stripIgnored(files, importless.getIgnored())
    expected = _.sortBy ['test/files/imported.less', 'test/files/test.less']
    test.deepEqual actual, expected
    importless.setIgnored []
    test.done()


exports['detectDependencies'] =
  setUp: (next) ->
    next()
  tearDown: (next) ->
