Skip to content

Commit aea568b

Browse files
committed
Fix rubocop issues
1 parent e440d40 commit aea568b

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def mock_model(string_or_model_class, stubs={})
106106
model_class = Object.const_set(string_or_model_class, Class.new do
107107
# rubocop:disable Style/SingleLineMethods
108108
extend ::ActiveModel::Naming
109+
109110
def self.primary_key; :id; end
110111

111112
# For detection of being a valid association in 7+
@@ -149,6 +150,7 @@ def self.param_delimiter; "-"; end
149150
msingleton = class << m; self; end
150151
msingleton.class_eval do
151152
include ActiveModelInstanceMethods
153+
152154
include ActiveRecordInstanceMethods if defined?(ActiveRecord)
153155
include ActiveModel::Conversion
154156
include ActiveModel::Validations

spec/rspec/active_model/mocks/mock_model_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,7 @@ def self.===(_other)
557557
ERR
558558
end
559559
include Test::Unit::Assertions
560+
560561
if defined?((Test::Unit::AutoRunner.need_auto_run = ()))
561562
Test::Unit::AutoRunner.need_auto_run = false
562563
elsif defined?((Test::Unit.run = ()))
@@ -570,6 +571,7 @@ def self.===(_other)
570571
else
571572
require 'test/unit/assertions'
572573
include Test::Unit::Assertions
574+
573575
if defined?((Test::Unit::AutoRunner.need_auto_run = ()))
574576
Test::Unit::AutoRunner.need_auto_run = false
575577
elsif defined?((Test::Unit.run = ()))

spec/support/ar_classes.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class NonActiveRecordModel
4141

4242
class MockableModel < ActiveRecord::Base
4343
extend Connections
44+
4445
has_one :associated_model
4546
end
4647

@@ -54,12 +55,14 @@ class SubMockableModel < MockableModel
5455

5556
class AssociatedModel < ActiveRecord::Base
5657
extend Connections
58+
5759
belongs_to :mockable_model
5860
belongs_to :nonexistent_model, :class_name => "Other"
5961
end
6062

6163
class AlternatePrimaryKeyModel < ActiveRecord::Base
6264
self.primary_key = :my_id
6365
extend Connections
66+
6467
attr_accessor :my_id
6568
end

0 commit comments

Comments
 (0)