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: globals:
expect: true expect: true
source: true lib: true
stub: true stub: true
spy: true spy: true
chai: true chai: true

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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