Skip to content

Commit

Permalink
Removes folders and updates paths
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbc committed Apr 19, 2017
1 parent 62b68e7 commit 14d044b
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/darwin.spec.js → 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('../lib/darwin', {
let darwin = proxyquire('./darwin', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'sysctl -n kern.boottime', 'should call sysctl command');
Expand Down
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('./lib/darwin');
module.exports = require('./darwin');
} else if (process.platform === 'linux') {
module.exports = require('./lib/linux');
module.exports = require('./linux');
} else if (process.platform === 'win32') {
module.exports = require('./lib/win32');
module.exports = require('./win32');
} else {
throw new Error('Only linux, darwin and win32 are supported, you have: ' + process.platform);
}
24 changes: 12 additions & 12 deletions test/index.spec.js → index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ describe('index', function () {
});

it('should require darwin', function () {
let uptime = proxyquire('../index', {
'./lib/darwin': {
let uptime = proxyquire('./index', {
'./darwin': {
type: 'darwin'
},
'./lib/linux': {
'./linux': {
type: 'linux'
},
'./lib/win32': {
'./win32': {
type: 'win32'
}
});
Expand All @@ -38,14 +38,14 @@ describe('index', function () {
});

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

it('should require win32', function () {
let uptime = proxyquire('../index', {
'./lib/darwin': {
let uptime = proxyquire('./index', {
'./darwin': {
type: 'darwin'
},
'./lib/linux': {
'./linux': {
type: 'linux'
},
'./lib/win32': {
'./win32': {
type: 'win32'
}
});
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/linux.spec.js → 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('../lib/linux', {
let linux = proxyquire('./linux', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'uptime -s', 'should call uptime command');
Expand Down
8 changes: 4 additions & 4 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 './test/*.spec.js'",
"test": "mocha \"*.spec.js\"",
"test:watch": "npm test -- -w -b"
},
"repository": {
Expand Down Expand Up @@ -40,10 +40,10 @@
"pre-commit": [
"test"
],
"directories": {},
"files": [
"darwin.js",
"index.js",
"lib",
"test"
"linux.js",
"win32"
]
}
File renamed without changes.
2 changes: 1 addition & 1 deletion test/win32.spec.js → 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('../lib/win32', {
let win32 = proxyquire('./win32', {
'child_process': {
execSync: (cmd) => {
assert.equal(cmd, 'net statistics workstation', 'should call net statistics workstation command');
Expand Down

0 comments on commit 14d044b

Please sign in to comment.