s/source/lib for loading files for specs
This commit is contained in:
parent
68ab6ad441
commit
8adacef282
|
@ -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
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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" });
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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();
|
||||||
|
|
||||||
|
|
|
@ -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";
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
|
@ -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() {
|
||||||
|
|
Loading…
Reference in New Issue