s/source/lib for loading files for specs
This commit is contained in:
parent
68ab6ad441
commit
8adacef282
|
@ -3,7 +3,7 @@ env:
|
|||
|
||||
globals:
|
||||
expect: true
|
||||
source: true
|
||||
lib: true
|
||||
stub: true
|
||||
spy: true
|
||||
chai: true
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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" });
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var Utils = source("io/utils.js");
|
||||
var Utils = lib("io/utils.js");
|
||||
|
||||
describe("IOUtils", function() {
|
||||
describe("#periodAndDuty", function() {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var logger = source("logger/basic_logger");
|
||||
var logger = lib("logger/basic_logger");
|
||||
|
||||
var date = new Date(0).toISOString();
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var Registry = source("registry");
|
||||
var Registry = lib("registry");
|
||||
|
||||
var path = "./../spec/support/mock_module.js";
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var utils = source("utils");
|
||||
var utils = lib("utils");
|
||||
|
||||
describe("Utils", function() {
|
||||
describe("Monkey-patches", function() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
var _ = source("utils/helpers");
|
||||
var _ = lib("utils/helpers");
|
||||
|
||||
describe("Helpers", function() {
|
||||
describe("extend", function() {
|
||||
|
|
Loading…
Reference in New Issue