Skip to content

Commit baf3bc6

Browse files
committed
Add disables for rules were refactoring is impractical
1 parent ff0ef87 commit baf3bc6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def association(association_name)
7474
end
7575
end
7676

77+
# rubocop:disable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
78+
7779
# Creates a test double representing `string_or_model_class` with common
7880
# ActiveModel methods stubbed out. Additional methods may be easily
7981
# stubbed (via add_stubs) if `stubs` is passed. This is most useful for
@@ -194,6 +196,7 @@ def self.param_delimiter; "-"; end
194196
yield m if block_given?
195197
end
196198
end
199+
# rubocop:enable Metrics/AbcSize,Metrics/CyclomaticComplexity,Metrics/MethodLength,Metrics/PerceivedComplexity
197200

198201
module ActiveModelStubExtensions
199202
# Stubs `persisted` to return false and `id` to return nil
@@ -229,6 +232,8 @@ def connection
229232
end
230233
end
231234

235+
# rubocop:disable Metrics/AbcSize,Metrics/MethodLength
236+
232237
# Creates an instance of `Model` with `to_param` stubbed using a
233238
# generated value that is unique to each object. If `Model` is an
234239
# `ActiveRecord` model, it is prohibited from accessing the database.
@@ -285,14 +290,17 @@ def stub_model(model_class, stubs={})
285290
yield m if block_given?
286291
end
287292
end
293+
# rubocop:enable Metrics/AbcSize,Metrics/MethodLength
288294

289295
private
290296

297+
# rubocop:disable Style/ClassVars
291298
@@model_id = 1000
292299

293300
def next_id
294301
@@model_id += 1
295302
end
303+
# rubocop:enable Style/ClassVars
296304
end
297305
end
298306

spec/rspec/active_model/mocks/mock_model_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ def self.===(_other)
470470
end
471471

472472
describe "ActiveModel Lint tests" do
473+
# rubocop:disable Lint/EmptyExpression,Metrics/BlockNesting
473474
begin
474475
require 'minitest/assertions'
475476
include Minitest::Assertions
@@ -525,6 +526,7 @@ def self.===(_other)
525526
end
526527
end
527528
end
529+
# rubocop:enable Lint/EmptyExpression,Metrics/BlockNesting
528530

529531
require 'active_model/lint'
530532
include ActiveModel::Lint::Tests

0 commit comments

Comments
 (0)