diff --git a/lib/container.js b/lib/container.js index bc23016..bf58042 100644 --- a/lib/container.js +++ b/lib/container.js @@ -3,7 +3,7 @@ var _ = require('underscore'); var Container = function(modem, id) { this.modem = modem; this.id = id; - + this.defaultOptions = { top: {}, start: {}, @@ -15,7 +15,7 @@ var Container = function(modem, id) { remove: {}, copy: {} }; - + }; Container.prototype.inspect = function(callback) { @@ -104,6 +104,7 @@ Container.prototype.start = function(opts, callback) { method: 'POST', statusCodes: { 204: true, + 304: "container already started", 404: "no such container", 500: "server error" }, @@ -150,6 +151,7 @@ Container.prototype.stop = function(opts, callback) { method: 'POST', statusCodes: { 204: true, + 304: "container already stopped", 404: "no such container", 500: "server error" }, @@ -258,7 +260,7 @@ Container.prototype.remove = function(opts, callback) { callback = opts; opts = {}; } - + var optsf = { path: '/containers/' + this.id + '?', method: 'DELETE', diff --git a/package.json b/package.json index ef522c6..188e62c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dockerode", "description": "Docker.io / Docker remote API implementation.", - "version": "2.0.0", + "version": "2.0.1", "author": "Pedro Dias ", "maintainers": [ "apocas " diff --git a/test/container.js b/test/container.js index 3170f86..903a60b 100644 --- a/test/container.js +++ b/test/container.js @@ -244,37 +244,22 @@ describe("#container", function() { container.changes(handler); }); }); - + describe("#logs", function() { - - it("should get the logs for a container", function(done) { - this.timeout(30000); - var container = docker.getContainer(testContainer); - var logs_opts = { follow: false, stdout: true, stderr: true, timestamps: true }; - - function handler(err, logs) { - expect(err).to.be.null; - expect(logs).to.be.a('string'); - done(); - } - - container.logs(logs_opts, handler); - - }); - + it("should get the logs for a container as a stream", function(done) { this.timeout(30000); var container = docker.getContainer(testContainer); var logs_opts = { follow: true, stdout: true, stderr: true, timestamps: true }; - + function handler(err, stream) { expect(err).to.be.null; expect(stream.pipe).to.be.ok; done(); } - + container.logs(logs_opts, handler); - + }); }); @@ -319,7 +304,7 @@ describe("#non-responsive container", function() { var container = docker.getContainer(testContainer); function handler(err, data) { - expect(err).to.be.null; + expect(err).not.to.be.null; done(); }