Skip to content

Commit

Permalink
fix rubocop warns in Ruby client's custom spec (#5488)
Browse files Browse the repository at this point in the history
  • Loading branch information
autopp authored Mar 1, 2020
1 parent 165ad45 commit d094cca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 0 additions & 2 deletions samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,3 @@ def deserialize_json(s, type)
response = double('response', headers: headers, body: s)
API_CLIENT.deserialize(response, type)
end


0 comments on commit d094cca

Please sign in to comment.