From 1cfebe282d4989446d38b7e15983a5d54924324a Mon Sep 17 00:00:00 2001 From: archanaserver Date: Sat, 20 Jan 2024 04:24:29 +0530 Subject: [PATCH] Fix Layout/SpaceAroundMethodCallOperator cop --- .rubocop.yml | 17 +++++------------ .../controllers/api/v2/hosts_controller_test.rb | 4 ++-- test/models/compute_resources/ovirt_test.rb | 2 +- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f6c2897f98a5..0bb443023919 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -80,23 +80,15 @@ Style/ParenthesesAroundCondition: Style/PreferredHashMethods: Enabled: false -Minitest/AssertEmptyLiteral: - Enabled: true - -Minitest/AssertNil: - Exclude: - - 'test/graphql/queries/personal_access_token_query_test.rb' - Enabled: true - -Minitest/RefuteNil: - Enabled: true - Layout/ArgumentAlignment: - EnforcedStyle: with_fixed_indentation + Enabled: false Layout/SpaceAroundOperators: Enabled: true +Layout/SpaceAroundMethodCallOperator: + Enabled: true + Layout/EmptyLinesAroundAttributeAccessor: Enabled: true @@ -105,3 +97,4 @@ Layout/EmptyLineBetweenDefs: Layout/FirstHashElementIndentation: Enabled: false + diff --git a/test/controllers/api/v2/hosts_controller_test.rb b/test/controllers/api/v2/hosts_controller_test.rb index c0727459e161..e4438ade864f 100644 --- a/test/controllers/api/v2/hosts_controller_test.rb +++ b/test/controllers/api/v2/hosts_controller_test.rb @@ -833,7 +833,7 @@ def initialize_proxy_ops test "boot call to interface" do ProxyAPI::BMC.any_instance.stubs(:boot).with(:function => 'bootdevice', :device => 'bios'). - returns({ "action" => "bios", "result" => true } .to_json) + returns({ "action" => "bios", "result" => true }.to_json) put :boot, params: { :id => @bmchost.to_param, :device => 'bios' } assert_response :success assert @response.body =~ /true/ @@ -861,7 +861,7 @@ def initialize_proxy_ops test 'responds correctly for non-admin user if BMC is available' do ProxyAPI::BMC.any_instance.stubs(:boot). with(:function => 'bootdevice', :device => 'bios'). - returns({ "action" => "bios", "result" => true } .to_json) + returns({ "action" => "bios", "result" => true }.to_json) put :boot, params: { :id => @bmchost.to_param, :device => 'bios' }, session: set_session_user.merge(:user => @one.id) assert_response :success diff --git a/test/models/compute_resources/ovirt_test.rb b/test/models/compute_resources/ovirt_test.rb index 593a3a008ab8..d5ba2f21ea7c 100644 --- a/test/models/compute_resources/ovirt_test.rb +++ b/test/models/compute_resources/ovirt_test.rb @@ -1,7 +1,7 @@ require 'test_helper' require 'models/compute_resources/compute_resource_test_helpers' -class Foreman::Model:: OvirtTest < ActiveSupport::TestCase +class Foreman::Model::OvirtTest < ActiveSupport::TestCase include ComputeResourceTestHelpers should validate_presence_of(:url)