/* */ 
var should = require("should");
var Traceur = require("traceur");
Traceur.require.makeDefault(function(filename) {
  return !(/node_modules/.test(filename));
});
var isRelative = require("../lib/utils").isRelative;
var isAbsolute = require("../lib/utils").isAbsolute;
var isExternal = require("../lib/utils").isExternal;
var isTypeScript = require("../lib/utils").isTypeScript;
var isTypeScriptDeclaration = require("../lib/utils").isTypeScriptDeclaration;
describe('Utils', function() {
  describe('isRelative', function() {
    it('does not match absolute paths', function() {
      isRelative("/a/b.c").should.be.false;
      isRelative("/a/b").should.be.false;
    });
    it('matches relative paths', function() {
      isRelative("../a/b").should.be.true;
      isRelative("./a/b").should.be.true;
    });
    it('does not match external paths', function() {
      isRelative("b").should.be.false;
      isRelative("a/b.c").should.be.false;
    });
  });
  describe('isAbsolute', function() {
    it('matches absolute paths', function() {
      isAbsolute("/a/b.c").should.be.true;
      isAbsolute("/a/b").should.be.true;
    });
    it('does not match relative paths', function() {
      isAbsolute("../a/b").should.be.false;
      isAbsolute("./a/b").should.be.false;
    });
    it('does not match external paths', function() {
      isAbsolute("b").should.be.false;
      isAbsolute("a/b.c").should.be.false;
    });
  });
  describe('isExternal', function() {
    it('does not match absolute paths', function() {
      isExternal("/a/b.c").should.be.false;
      isExternal("/a/b").should.be.false;
    });
    it('does not match relative paths', function() {
      isExternal("../a/b").should.be.false;
      isExternal("./a/b").should.be.false;
    });
    it('matches external paths', function() {
      isExternal("b").should.be.true;
      isExternal("a/b.c").should.be.true;
    });
  });
});
