From d094cca99aecc7287529bd5240481a629bc9dc9d Mon Sep 17 00:00:00 2001 From: Akira Tanimura Date: Sun, 1 Mar 2020 11:54:17 +0900 Subject: [PATCH] fix rubocop warns in Ruby client's custom spec (#5488) --- samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb | 4 ++-- samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb b/samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb index c56be964a2f0..8bce8cff5fc7 100644 --- a/samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb +++ b/samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb @@ -23,7 +23,7 @@ tag1 = Petstore::Tag.new('id' => 1, 'name' => 'tag1') tag2 = Petstore::Tag.new('id' => 2, 'name' => 'tag2') category1 = Petstore::Category.new(:id => 1, :name => 'category unknown') - # initalize using both string and symbol key + # initialize using both string and symbol key pet_hash = { :id => @pet_id, :name => "RUBY UNIT TESTING", @@ -79,7 +79,7 @@ rescue Petstore::ApiError => e expect(e.code).to eq(404) # skip the check as the response contains a timestamp that changes on every reponse - #expect(e.message).to eq("Error message: the server returns an error\nHTTP status code: 404\nResponse headers: {\"Date\"=>\"Tue, 26 Feb 2019 04:35:40 GMT\", \"Access-Control-Allow-Origin\"=>\"*\", \"Access-Control-Allow-Methods\"=>\"GET, POST, DELETE, PUT\", \"Access-Control-Allow-Headers\"=>\"Content-Type, api_key, Authorization\", \"Content-Type\"=>\"application/json\", \"Connection\"=>\"close\", \"Server\"=>\"Jetty(9.2.9.v20150224)\"}\nResponse body: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}") + # expect(e.message).to eq("Error message: the server returns an error\nHTTP status code: 404\nResponse headers: {\"Date\"=>\"Tue, 26 Feb 2019 04:35:40 GMT\", \"Access-Control-Allow-Origin\"=>\"*\", \"Access-Control-Allow-Methods\"=>\"GET, POST, DELETE, PUT\", \"Access-Control-Allow-Headers\"=>\"Content-Type, api_key, Authorization\", \"Content-Type\"=>\"application/json\", \"Connection\"=>\"close\", \"Server\"=>\"Jetty(9.2.9.v20150224)\"}\nResponse body: {\"code\":1,\"type\":\"error\",\"message\":\"Pet not found\"}") expect(e.response_body).to eq('{"code":1,"type":"error","message":"Pet not found"}') expect(e.response_headers).to include('Content-Type') expect(e.response_headers['Content-Type']).to eq('application/json') diff --git a/samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb b/samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb index 96b0711cec54..8ce74cf4252b 100644 --- a/samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb +++ b/samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb @@ -48,5 +48,3 @@ def deserialize_json(s, type) response = double('response', headers: headers, body: s) API_CLIENT.deserialize(response, type) end - -