Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/docker/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def connect(container, opts = {}, body_opts = {})
reload
end

def disconnect(container, opts = {})
body = MultiJson.dump(container: container)
def disconnect(container, opts = {}, body_opts = {})
body = MultiJson.dump({ container: container }.merge(body_opts))
Docker::Util.parse_json(
connection.post(path_for('disconnect'), opts, body: body)
)
Expand Down
7 changes: 6 additions & 1 deletion spec/docker/network_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,15 @@
subject.remove
end

it 'connects a container to a network' do
it 'disconnects a container from a network' do
subject.disconnect(container.id)
expect(subject.info['Containers']).not_to include(container.id)
end

it 'force disconnects a container from a network' do
subject.disconnect(container.id, {}, force: true)
expect(subject.info['Containers']).not_to include(container.id)
end
end

describe '#remove' do
Expand Down