Skip to content

Commit

Permalink
Merge pull request #170 from swipely/fix-expects-and-container-run
Browse files Browse the repository at this point in the history
Add 304 not modified expectation and remove start on run
  • Loading branch information
tlunter committed Jul 24, 2014
2 parents ab8dfd2 + 25fd4df commit dd3b869
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/docker/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def compile_request_params(http_method, path, query = nil, opts = nil, &block)
:headers => { 'Content-Type' => content_type,
'User-Agent' => user_agent,
}.merge(headers),
:expects => (200..204),
:expects => (200..204).to_a << 304,
:idempotent => http_method == :get,
:request_block => block
}.merge(opts).reject { |_, v| v.nil? }
Expand Down
2 changes: 1 addition & 1 deletion lib/docker/container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def wait(time = nil)
# UnexpectedResponseError is raised.
def run(cmd, time = 1000)
if (code = tap(&:start).wait(time)['StatusCode']).zero?
commit.run(cmd).tap(&:start)
commit.run(cmd)
else
raise UnexpectedResponseError, "Command returned status code #{code}."
end
Expand Down

0 comments on commit dd3b869

Please sign in to comment.