s/source/lib for loading files for specs

This commit is contained in:
Andrew Stewart 2015-06-09 07:21:03 -07:00
parent 68ab6ad441
commit 8adacef282
14 changed files with 28 additions and 28 deletions

View File

@ -3,7 +3,7 @@ env:
globals:
expect: true
source: true
lib: true
stub: true
spy: true
chai: true

View File

@ -22,11 +22,11 @@ global.spy = sinon.spy;
global.stub = sinon.stub;
// convenience function to require modules in lib directory
global.source = function(module) {
global.lib = function(module) {
return require(path.normalize("./../lib/" + module));
};
var Cylon = source("cylon");
var Cylon = lib("cylon");
Cylon.config({
mode: "manual",

View File

@ -1,7 +1,7 @@
"use strict";
var Adaptor = source("adaptor"),
Utils = source("utils");
var Adaptor = lib("adaptor"),
Utils = lib("utils");
describe("Adaptor", function() {
var adaptor;

View File

@ -1,7 +1,7 @@
"use strict";
var Basestar = source("basestar"),
Utils = source("utils");
var Basestar = lib("basestar"),
Utils = lib("utils");
var EventEmitter = require("events").EventEmitter;

View File

@ -1,12 +1,12 @@
"use strict";
var Cylon = source("cylon"),
Robot = source("robot");
var Cylon = lib("cylon"),
Robot = lib("robot");
var Logger = source("logger"),
Adaptor = source("adaptor"),
Driver = source("driver"),
Config = source("config");
var Logger = lib("logger"),
Adaptor = lib("adaptor"),
Driver = lib("driver"),
Config = lib("config");
describe("Cylon", function() {
describe("exports", function() {

View File

@ -3,8 +3,8 @@
var fs = require("fs");
var DigitalPin = source("io/digital-pin"),
Utils = source("utils");
var DigitalPin = lib("io/digital-pin"),
Utils = lib("utils");
describe("Cylon.IO.DigitalPin", function() {
var pin = new DigitalPin({ pin: "4", mode: "w" });

View File

@ -1,7 +1,7 @@
"use strict";
var Driver = source("driver"),
Utils = source("utils");
var Driver = lib("driver"),
Utils = lib("utils");
describe("Driver", function() {
var connection, driver;

View File

@ -1,6 +1,6 @@
"use strict";
var Utils = source("io/utils.js");
var Utils = lib("io/utils.js");
describe("IOUtils", function() {
describe("#periodAndDuty", function() {

View File

@ -1,7 +1,7 @@
"use strict";
var Logger = source("logger"),
Config = source("config");
var Logger = lib("logger"),
Config = lib("config");
describe("Logger", function() {
afterEach(function() {

View File

@ -1,6 +1,6 @@
"use strict";
var logger = source("logger/basic_logger");
var logger = lib("logger/basic_logger");
var date = new Date(0).toISOString();

View File

@ -1,6 +1,6 @@
"use strict";
var Registry = source("registry");
var Registry = lib("registry");
var path = "./../spec/support/mock_module.js";

View File

@ -1,9 +1,9 @@
"use strict";
var Driver = source("driver"),
Adaptor = source("adaptor"),
Robot = source("robot"),
Logger = source("logger");
var Driver = lib("driver"),
Adaptor = lib("adaptor"),
Robot = lib("robot"),
Logger = lib("logger");
describe("Robot", function() {
var work, extraFunction, robot;

View File

@ -1,6 +1,6 @@
"use strict";
var utils = source("utils");
var utils = lib("utils");
describe("Utils", function() {
describe("Monkey-patches", function() {

View File

@ -1,6 +1,6 @@
"use strict";
var _ = source("utils/helpers");
var _ = lib("utils/helpers");
describe("Helpers", function() {
describe("extend", function() {