Skip to content

Commit

Permalink
making everything identical for strings and seperate versions
Browse files Browse the repository at this point in the history
  • Loading branch information
laferrieren committed Nov 1, 2015
1 parent 62d5cd3 commit 09751f3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions spec/docker_via_api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@

it 'lists processes' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/json', {}).
with(excon_uri + "v1.12" + "/containers/json", {}).
and_return(double(body: json_string, status: 200))
expect(api.ps).to eq(json_value)
end

it 'lists all processes' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/json?all=1', {}).
with(excon_uri + "v1.12" + "/containers/json?all=1", {}).
and_return(double(body: json_string, status: 200))
expect(api.ps(all: true)).to eq(json_value)
end
Expand Down Expand Up @@ -62,14 +62,14 @@

it 'stops a container' do
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/12345/stop?t=300', {}).
with(excon_uri + "v1.12" + "/containers/12345/stop?t=300", {}).
and_return(double(status: 204))
api.stop_container('12345', 300)
end

it 'stops a container with a custom timeout' do
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/12345/stop?t=30', {}).
with(excon_uri + "v1.12" + "/containers/12345/stop?t=30", {}).
and_return(double(status: 204))
api.stop_container('12345')
end
Expand All @@ -90,14 +90,14 @@

it 'inspects a container' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/12345/json', {}).
with(excon_uri + "v1.12" + "/containers/12345/json", {}).
and_return(double(body: json_string, status: 200))
expect(api.inspect_container('12345')).to eq(json_value)
end

it 'removes a container' do
expect(Excon).to receive(:delete).
with(excon_uri + 'v1.12/containers/12345', {}).
with(excon_uri + "v1.12" + "/containers/12345", {}).
and_return(double(status: 204))
expect(api.remove_container('12345')).to eq(true)
end
Expand All @@ -120,7 +120,7 @@

it 'lists processes' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/json',
with(excon_uri + "v1.12" + "/containers/json",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(body: json_string, status: 200))
Expand All @@ -129,7 +129,7 @@

it 'lists all processes' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/json?all=1',
with(excon_uri + "v1.12" + "/containers/json?all=1",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(body: json_string, status: 200))
Expand All @@ -138,7 +138,7 @@

it 'inspects an image' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/images/foo:bar/json',
with(excon_uri + "v1.12" + "/images/foo:bar/json",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem',
headers: {'Accept' => 'application/json'}).
Expand All @@ -150,7 +150,7 @@
configuration_as_json = double
configuration = double(to_json: configuration_as_json)
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/create',
with(excon_uri + "v1.12" + "/containers/create",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem',
query: nil,
Expand All @@ -164,7 +164,7 @@
configuration_as_json = double
configuration = double(to_json: configuration_as_json)
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/12345/start',
with(excon_uri + "v1.12" + "/containers/12345/start",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem',
body: configuration_as_json,
Expand All @@ -175,7 +175,7 @@

it 'stops a container' do
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/12345/stop?t=300',
with(excon_uri + "v1.12" + "/containers/12345/stop?t=300",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(status: 204))
Expand All @@ -184,7 +184,7 @@

it 'stops a container with a custom timeout' do
expect(Excon).to receive(:post).
with(excon_uri + 'v1.12/containers/12345/stop?t=30',
with(excon_uri + "v1.12" + "/containers/12345/stop?t=30",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(status: 204))
Expand All @@ -211,7 +211,7 @@

it 'inspects a container' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/12345/json',
with(excon_uri + "v1.12" + "/containers/12345/json",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(body: json_string, status: 200))
Expand All @@ -220,7 +220,7 @@

it 'removes a container' do
expect(Excon).to receive(:delete).
with(excon_uri + 'v1.12/containers/12345',
with(excon_uri + "v1.12" + "/containers/12345",
client_cert: '/certs/cert.pem',
client_key: '/certs/key.pem').
and_return(double(status: 204))
Expand All @@ -235,7 +235,7 @@

it 'lists processes' do
expect(Excon).to receive(:get).
with(excon_uri + 'v1.12/containers/json',
with(excon_uri + "v1.12" + "/containers/json",
client_cert: File.expand_path('~/.docker/cert.pem'),
client_key: File.expand_path('~/.docker/key.pem')).
and_return(double(body: json_string, status: 200))
Expand Down

0 comments on commit 09751f3

Please sign in to comment.