Skip to content

Commit

Permalink
Changes paths
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbc committed Apr 7, 2017
1 parent 3be2a9f commit 7345525
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

if (process.platform === 'darwin') {
module.exports = require('./platform/darwin');
module.exports = require('./lib/darwin');
} else if (process.platform === 'linux') {
module.exports = require('./platform/linux');
module.exports = require('./lib/linux');
} else if (process.platform === 'win32') {
module.exports = require('./platform/win32');
module.exports = require('./lib/win32');
} else {
throw new Error('Only linux, darwin and win32 are supported, you have: ' + process.platform);
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha './tests/*.spec.js'",
"test": "mocha './test/*.spec.js'",
"test:watch": "npm test -- -w -b"
},
"repository": {
Expand Down Expand Up @@ -42,6 +42,6 @@
],
"files": [
"index.js",
"./platform/*.js"
"./lib/*.js"
]
}
2 changes: 1 addition & 1 deletion test/darwin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');

describe('darwin', () => {
it('should parse the date', () => {
let darwin = proxyquire('../platform/darwin', {
let darwin = proxyquire('../lib/darwin', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'sysctl -n kern.boottime', 'should call sysctl command');
Expand Down
16 changes: 8 additions & 8 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ describe('index', function () {

it('should require darwin', function () {
let uptime = proxyquire('../index', {
'./platform/darwin': {
'./lib/darwin': {
type: 'darwin'
},
'./platform/linux': {
'./lib/linux': {
type: 'linux'
},
'./platform/win32': {
'./lib/win32': {
type: 'win32'
}
});
Expand All @@ -42,10 +42,10 @@ describe('index', function () {
'./plaform/darwin': {
type: 'darwin'
},
'./platform/linux': {
'./lib/linux': {
type: 'linux'
},
'./platform/win32': {
'./lib/win32': {
type: 'win32'
}
});
Expand All @@ -61,13 +61,13 @@ describe('index', function () {

it('should require win32', function () {
let uptime = proxyquire('../index', {
'./plaform/darwin': {
'./lib/darwin': {
type: 'darwin'
},
'./platform/linux': {
'./lib/linux': {
type: 'linux'
},
'./platform/win32': {
'./lib/win32': {
type: 'win32'
}
});
Expand Down
2 changes: 1 addition & 1 deletion test/linux.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');

describe('linux', () => {
it('should parse the date', () => {
let linux = proxyquire('../platform/linux', {
let linux = proxyquire('../lib/linux', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'uptime -s', 'should call uptime command');
Expand Down
2 changes: 1 addition & 1 deletion test/win32.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const assert = require('assert');

describe('win32', () => {
it('should parse the date', () => {
let win32 = proxyquire('../platform/win32', {
let win32 = proxyquire('../lib/win32', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'net statistics workstation', 'should call net statistics workstation command');
Expand Down

0 comments on commit 7345525

Please sign in to comment.