From cf271358108202ca7b2d68f8c5e5709190cc95db Mon Sep 17 00:00:00 2001 From: Yoann Lecuyer Date: Sat, 28 Dec 2024 16:57:50 +0100 Subject: [PATCH] CI: Add ruby 3.4 (#696) --- .github/workflows/test.yml | 2 +- changelog.md | 2 ++ spec/cases/http_service_spec.rb | 24 ++++++++++++++++++------ 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 014baddd..734e3654 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.7, "3.0", 3.1, 3.2, 3.3, head] + ruby: [2.7, "3.0", 3.1, 3.2, 3.3, 3.4, head] steps: - name: Checkout repository diff --git a/changelog.md b/changelog.md index ca86e504..c7b51f51 100644 --- a/changelog.md +++ b/changelog.md @@ -15,6 +15,8 @@ Internal improvements: Testing improvements: + * Add ruby 3.4 to CI ([696](https://github.com/arsduo/koala/pull/696)) + Others: v3.6.0 (2024-06-27) diff --git a/spec/cases/http_service_spec.rb b/spec/cases/http_service_spec.rb index 03f4023f..3a4a4981 100644 --- a/spec/cases/http_service_spec.rb +++ b/spec/cases/http_service_spec.rb @@ -238,8 +238,12 @@ def adapter(arg) it 'logs tokens' do allow(Koala.config).to receive(:mask_tokens) { false } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleaccesstoken"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleaccesstoken"}/) + end Koala::HTTPService.make_request(request) end @@ -247,8 +251,12 @@ def adapter(arg) it 'doesnt log tokens' do allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /foo params: {"an"=>:arg, "access_token"=>"myvisbleac*****token"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/foo params: {"an"\s?=>\s?:arg, "access_token"\s?=>\s?"myvisbleac[*]{5}token"}/) + end Koala::HTTPService.make_request(request) end @@ -258,8 +266,12 @@ def adapter(arg) allow(Koala.config).to receive(:mask_tokens) { true } - expect(Koala::Utils).to receive(:debug).with('STARTED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}') - expect(Koala::Utils).to receive(:debug).with('FINISHED => GET: /debug_token params: {"input_token"=>"myvisiblea*****token", "access_token"=>"myvisiblea*****token"}') + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/STARTED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/) + end + expect(Koala::Utils).to receive(:debug) do |log| + expect(log).to match(/FINISHED => GET: \/debug_token params: {"input_token"\s?=>\s?"myvisiblea[*]{5}token", "access_token"\s?=>\s?"myvisiblea[*]{5}token"}/) + end Koala::HTTPService.make_request(request) end