diff --git a/spec/docker_via_api_spec.rb b/spec/docker_via_api_spec.rb index 16be17f2..50f11a87 100644 --- a/spec/docker_via_api_spec.rb +++ b/spec/docker_via_api_spec.rb @@ -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 @@ -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 @@ -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 @@ -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)) @@ -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)) @@ -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'}). @@ -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, @@ -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, @@ -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)) @@ -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)) @@ -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)) @@ -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)) @@ -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))