From 379be816c2875fa11472895fa55695ebf728820b Mon Sep 17 00:00:00 2001 From: Vasily Fedoseyev Date: Tue, 24 Oct 2023 00:31:51 +0300 Subject: [PATCH] Rubocop --- lib/deprecation_collector/web/helpers.rb | 2 ++ lib/deprecation_collector/web/router.rb | 2 ++ spec/deprecation_collector/web_spec.rb | 6 ++---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/deprecation_collector/web/helpers.rb b/lib/deprecation_collector/web/helpers.rb index 3881643..4ac9d83 100644 --- a/lib/deprecation_collector/web/helpers.rb +++ b/lib/deprecation_collector/web/helpers.rb @@ -68,6 +68,8 @@ def detect_tag(deprecation) msg = deprecation[:message].to_s return :kwargs if msg.include?("Using the last argument as keyword parameters is deprecated") || msg.include?("Passing the keyword argument as the last hash parameter is deprecated") + + nil end def test_deprecation?(deprecation) diff --git a/lib/deprecation_collector/web/router.rb b/lib/deprecation_collector/web/router.rb index f8e7ecf..ebb93fe 100644 --- a/lib/deprecation_collector/web/router.rb +++ b/lib/deprecation_collector/web/router.rb @@ -172,6 +172,8 @@ def render(plain: nil, html: nil, json: nil, erb: nil, slim: nil, # rubocop:disa } return [status, { "content-type" => "text/html" }.merge(color_scheme_headers), [html.to_s]] if html + + nil end VIEW_PATH = "#{__dir__}/views" diff --git a/spec/deprecation_collector/web_spec.rb b/spec/deprecation_collector/web_spec.rb index e1b97fe..830acae 100644 --- a/spec/deprecation_collector/web_spec.rb +++ b/spec/deprecation_collector/web_spec.rb @@ -63,15 +63,13 @@ context "when disabled" do it "shows enable" do - allow(collector.storage).to receive(:support_disabling?).and_return(true) - allow(collector.storage).to receive(:enabled?).and_return(false) + allow(collector.storage).to receive_messages(support_disabling?: true, enabled?: false) get "/" expect(last_response.body).to include("/enable") end it "shows disable" do - allow(collector.storage).to receive(:support_disabling?).and_return(true) - allow(collector.storage).to receive(:enabled?).and_return(true) + allow(collector.storage).to receive_messages(support_disabling?: true, enabled?: true) get "/" expect(last_response.body).to include("/disable") expect(last_response.body).not_to include("/enable")