diff --git a/lib/push.js b/lib/swagger.js similarity index 93% rename from lib/push.js rename to lib/swagger.js index f99b502e8..f8a572a8e 100644 --- a/lib/push.js +++ b/lib/swagger.js @@ -5,7 +5,7 @@ var path = require('path'); exports.swagger = true; exports.login = true; -exports.desc = "Get a public URL for your API"; +exports.desc = 'Upload your swagger file to ReadMe'; exports.category = "services"; exports.run = function(config, info, cb) { @@ -26,6 +26,7 @@ exports.run = function(config, info, cb) { console.log(data); console.log("Success! ".green); } else { + console.log(data); console.error("There was an error uploading!".red); } diff --git a/package.json b/package.json index 0ffbd7715..b35e68f3f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "ReadMe (http://readme.io)", "name": "rdme", - "description": "Upload your Swagger file to ReadMe", + "description": "ReadMe's API CLI", "bin": { "rdme": "index.js" }, diff --git a/test/push.test.js b/test/swagger.test.js similarity index 74% rename from test/push.test.js rename to test/swagger.test.js index 5d29abceb..f768c0e59 100644 --- a/test/push.test.js +++ b/test/swagger.test.js @@ -1,12 +1,12 @@ const nock = require('nock'); const utils = require('../utils'); -const push = require('../lib/push'); +const swagger = require('../lib/swagger'); const config = utils.config('test'); const apiKey = 'Xmw4bGctRVIQz7R7dQXqH9nQe5d0SPQs' -describe('push action', () => { +describe('swagger action', () => { after(() => nock.cleanAll()); it('should POST to the swagger api if no id provided', (done) => { @@ -14,7 +14,7 @@ describe('push action', () => { return body.match('form-data; name=\"swagger\"'); }).basicAuth({ user: apiKey }).reply(201); - push.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: apiKey } }, (err) => { + swagger.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: apiKey } }, (err) => { if (err) return done(err); mock.done(); @@ -28,7 +28,7 @@ describe('push action', () => { return body.match('form-data; name=\"swagger\"'); }).basicAuth({ user: apiKey }).reply(201); - push.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: `${apiKey}-${id}` } }, (err) => { + swagger.run(config, { args: ['./test/fixtures/json/swagger.json'], opts: { token: `${apiKey}-${id}` } }, (err) => { if (err) return done(err); mock.done(); diff --git a/test/test.js b/test/utils.test.js similarity index 100% rename from test/test.js rename to test/utils.test.js