Skip to content

Commit 4a3ee40

Browse files
committed
Allow single line methods in our mock model function
1 parent fbfb04b commit 4a3ee40

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/rspec/active_model/mocks/mocks.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ def mock_model(string_or_model_class, stubs={})
9797
model_class = Object.const_get(string_or_model_class)
9898
else
9999
model_class = Object.const_set(string_or_model_class, Class.new do
100+
# rubocop:disable Style/SingleLineMethods
100101
extend ::ActiveModel::Naming
101102
def self.primary_key; :id; end
102103

@@ -106,6 +107,7 @@ def self._reflect_on_association(_other); nil; end
106107
def self.composite_primary_key?; false; end
107108
def self.has_query_constraints?; false; end
108109
def self.param_delimiter; "-"; end
110+
# rubocop:enable Style/SingleLineMethods
109111
end)
110112
end
111113
else

0 commit comments

Comments
 (0)