From acf5a2c955d343fb4509b9d7e35552f0107859f3 Mon Sep 17 00:00:00 2001 From: James 'zofrex' Sanderson Date: Tue, 5 Oct 2021 19:01:15 +0100 Subject: [PATCH] Fix Rubocop issues Signed-off-by: James 'zofrex' Sanderson --- lib/inspec/resources/service.rb | 2 +- test/helpers/mock_loader.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/inspec/resources/service.rb b/lib/inspec/resources/service.rb index b6a2325f5..e7805da6a 100644 --- a/lib/inspec/resources/service.rb +++ b/lib/inspec/resources/service.rb @@ -504,7 +504,7 @@ module Inspec::Resources # search for the service - srv = /(^.*\/#{service_name}$)/.match(cmd.stdout) + srv = %r{^.*/#{service_name}$)}.match(cmd.stdout) return nil if srv.nil? || srv[0].nil? enabled = true diff --git a/test/helpers/mock_loader.rb b/test/helpers/mock_loader.rb index cb5a1b4a6..29b1ff806 100644 --- a/test/helpers/mock_loader.rb +++ b/test/helpers/mock_loader.rb @@ -640,7 +640,7 @@ class MockLoader if @platform && (@platform[:name] == "freebsd" && @platform[:release].to_f >= 10) mock_cmds.merge!( - "service sendmail enabled" => cmd.call("service-sendmail-enabled"), + "service sendmail enabled" => cmd.call("service-sendmail-enabled") ) end