Skip to content

Commit d0902b3

Browse files
authored
Merge pull request #67 from rspec/rubocop-fixes
Tweak formatting for updated rubocop rules
2 parents 748032c + b0fa869 commit d0902b3

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

.rubocop_rspec_base.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Style/PercentLiteralDelimiters:
8484

8585
# We have too many special cases where we allow generator methods or prefer a
8686
# prefixed predicate due to it's improved readability.
87-
Naming/PredicateName:
87+
Naming/PredicatePrefix:
8888
Enabled: false
8989

9090
# On 1.8 `proc` is `lambda`, so we use `Proc.new` to ensure we get real procs on all supported versions.

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def mock_model(string_or_model_class, stubs={})
103103
model_class = Object.const_set(string_or_model_class, Class.new do
104104
# rubocop:disable Style/SingleLineMethods
105105
extend ::ActiveModel::Naming
106+
106107
def self.primary_key; :id; end
107108

108109
# For detection of being a valid association in 7+

spec/rspec/active_model/mocks/mock_model_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,7 @@ def self.===(_other)
519519
ERR
520520
end
521521
include Test::Unit::Assertions
522+
522523
if defined?((Test::Unit::AutoRunner.need_auto_run = ()))
523524
Test::Unit::AutoRunner.need_auto_run = false
524525
elsif defined?((Test::Unit.run = ()))
@@ -532,6 +533,7 @@ def self.===(_other)
532533
else
533534
require 'test/unit/assertions'
534535
include Test::Unit::Assertions
536+
535537
if defined?((Test::Unit::AutoRunner.need_auto_run = ()))
536538
Test::Unit::AutoRunner.need_auto_run = false
537539
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)