Skip to content

Commit d094cca

Browse files
authored
fix rubocop warns in Ruby client's custom spec (#5488)
1 parent 165ad45 commit d094cca

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

samples/openapi3/client/petstore/ruby/spec/custom/pet_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
tag1 = Petstore::Tag.new('id' => 1, 'name' => 'tag1')
2424
tag2 = Petstore::Tag.new('id' => 2, 'name' => 'tag2')
2525
category1 = Petstore::Category.new(:id => 1, :name => 'category unknown')
26-
# initalize using both string and symbol key
26+
# initialize using both string and symbol key
2727
pet_hash = {
2828
:id => @pet_id,
2929
:name => "RUBY UNIT TESTING",
@@ -79,7 +79,7 @@
7979
rescue Petstore::ApiError => e
8080
expect(e.code).to eq(404)
8181
# skip the check as the response contains a timestamp that changes on every reponse
82-
#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\"}")
82+
# 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\"}")
8383
expect(e.response_body).to eq('{"code":1,"type":"error","message":"Pet not found"}')
8484
expect(e.response_headers).to include('Content-Type')
8585
expect(e.response_headers['Content-Type']).to eq('application/json')

samples/openapi3/client/petstore/ruby/spec/petstore_helper.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,3 @@ def deserialize_json(s, type)
4848
response = double('response', headers: headers, body: s)
4949
API_CLIENT.deserialize(response, type)
5050
end
51-
52-

0 commit comments

Comments
 (0)