Permalink
Browse files

refactor: rename DreddCommand to CLI

  • Loading branch information...
michalholasek
michalholasek committed Jun 19, 2018
1 parent 5f91b67 commit f3c70efa9d4382d01098a32dcee0fa893e2726f5
View
@@ -12,10 +12,10 @@ var path = require('path');
var dir = process.env.COVERAGE_DIR ? 'src' : 'lib';
var DreddCommand = require('../' + dir + '/cli');
var CLI = require('../' + dir + '/cli');
var dreddCli = new DreddCommand({
var dreddCli = new CLI({
custom: {
cwd: process.cwd(),
argv: process.argv.slice(2)
View
@@ -14,7 +14,7 @@ const { spawn } = require('./child-process');
const packageData = require('../package.json');
class DreddCommand {
class CLI {
constructor(options = {}, cb) {
this.cb = cb;
this.finished = false;
@@ -400,4 +400,4 @@ ${packageData.name} v${packageData.version} \
}
}
module.exports = DreddCommand;
module.exports = CLI;
View
@@ -38,7 +38,7 @@ function applyConfiguration(config) {
emitter: new EventEmitter(),
hooksCode: null,
custom: { // Used for custom settings of various APIs or reporters
// Keep commented-out, so these values are actually set by DreddCommand
// Keep commented-out, so these values are actually set by CLI
// cwd: process.cwd()
},
options: {
@@ -1,6 +1,6 @@
const { assert } = require('chai');
const { runDreddCommandWithServer, createServer, DEFAULT_SERVER_PORT } = require('../helpers');
const { runCLIWithServer, createServer, DEFAULT_SERVER_PORT } = require('../helpers');
describe('CLI - API Blueprint Document', () => {
describe('when loaded from file', () => {
@@ -12,7 +12,7 @@ describe('CLI - API Blueprint Document', () => {
const app = createServer();
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -31,7 +31,7 @@ describe('CLI - API Blueprint Document', () => {
beforeEach((done) => {
const app = createServer();
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -51,7 +51,7 @@ describe('CLI - API Blueprint Document', () => {
beforeEach((done) => {
const app = createServer();
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -2,7 +2,7 @@ const fs = require('fs');
const os = require('os');
const { assert } = require('chai');
const { runDreddCommandWithServer, createServer, DEFAULT_SERVER_PORT } = require('../helpers');
const { runCLIWithServer, createServer, DEFAULT_SERVER_PORT } = require('../helpers');
const NON_EXISTENT_PORT = DEFAULT_SERVER_PORT + 1;
@@ -16,7 +16,7 @@ describe('CLI - API Description Document', () => {
const app = createServer();
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -35,7 +35,7 @@ describe('CLI - API Description Document', () => {
beforeEach((done) => {
const app = createServer();
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -54,7 +54,7 @@ describe('CLI - API Description Document', () => {
beforeEach((done) => {
const app = createServer();
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -82,7 +82,7 @@ describe('CLI - API Description Document', () => {
});
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -102,7 +102,7 @@ describe('CLI - API Description Document', () => {
beforeEach((done) => {
const app = createServer();
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -128,7 +128,7 @@ describe('CLI - API Description Document', () => {
const app = createServer();
app.get('/__non-existent__.apib', (req, res) => res.sendStatus(404));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -159,7 +159,7 @@ describe('CLI - API Description Document', () => {
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
app.get('/machines/willy', (req, res) => res.json({ type: 'bulldozer', name: 'willy' }));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -186,7 +186,7 @@ describe('CLI - API Description Document', () => {
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
app.get('/machines/willy', (req, res) => res.json({ type: 'bulldozer', name: 'willy' }));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -212,7 +212,7 @@ describe('CLI - API Description Document', () => {
app.get('/machines/willy', (req, res) => res.json({ type: 'bulldozer', name: 'willy' }));
app.get('/machines/caterpillar', (req, res) => res.json({ type: 'bulldozer', name: 'caterpillar' }));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -235,7 +235,7 @@ describe('CLI - API Description Document', () => {
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
app.get('/machines/willy', (req, res) => res.json({ type: 'bulldozer', name: 'willy' }));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
@@ -257,7 +257,7 @@ describe('CLI - API Description Document', () => {
const app = createServer();
app.get('/machines', (req, res) => res.json([{ type: 'bulldozer', name: 'willy' }]));
runDreddCommandWithServer(args, app, (err, info) => {
runCLIWithServer(args, app, (err, info) => {
runtimeInfo = info;
done(err);
});
Oops, something went wrong.

0 comments on commit f3c70ef

Please sign in to comment.