From a7a5985b0fe08bab3af5c3f775d5ee53eaf635d2 Mon Sep 17 00:00:00 2001 From: Daniel Pepper Date: Sat, 29 Aug 2020 21:14:03 -0700 Subject: [PATCH] fix warnings Ruby 2.7 deprecates automatic conversion from a hash to keyword arguments https://blog.saeloun.com/2019/10/07/ruby-2-7-keyword-arguments-redesign.html fixing those up, plus one more I noticed in the logs from https://github.com/JsonApiClient/json_api_client/pull/370#issuecomment-683349721 https://travis-ci.org/github/JsonApiClient/json_api_client/jobs/722402404 thanks @sharshenov --- lib/json_api_client/query/requestor.rb | 20 ++++++++++++-------- test/unit/errors_test.rb | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/json_api_client/query/requestor.rb b/lib/json_api_client/query/requestor.rb index 6d0704bb..d7f32c93 100644 --- a/lib/json_api_client/query/requestor.rb +++ b/lib/json_api_client/query/requestor.rb @@ -10,17 +10,21 @@ def initialize(klass) # expects a record def create(record) - request(:post, klass.path(record.path_attributes), { - body: { data: record.as_json_api }, - params: record.request_params.to_params - }) + request( + :post, + klass.path(record.path_attributes), + body: { data: record.as_json_api }, + params: record.request_params.to_params + ) end def update(record) - request(:patch, resource_path(record.path_attributes), { - body: { data: record.as_json_api }, - params: record.request_params.to_params - }) + request( + :patch, + resource_path(record.path_attributes), + body: { data: record.as_json_api }, + params: record.request_params.to_params + ) end def get(params = {}) diff --git a/test/unit/errors_test.rb b/test/unit/errors_test.rb index dbfb04ac..0627f134 100644 --- a/test/unit/errors_test.rb +++ b/test/unit/errors_test.rb @@ -10,7 +10,7 @@ def test_connection_errors User.all end - assert_match /specific message/, err.message + assert_match(/specific message/, err.message) end def test_timeout_errors