@@ -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
297305end
298306
0 commit comments