File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
lib/rspec/active_model/mocks Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -135,16 +135,15 @@ def self.param_delimiter; "-"; end
135135 :blank? => false } . merge ( stubs )
136136
137137 double ( "#{ model_class . name } _#{ stubs [ :id ] } " , stubs ) . tap do |m |
138- mock_store_klass = RSpec ::ActiveModel ::Mocks ::Mocks
139138 if model_class . method ( :=== ) . owner == Module && !stubs . key? ( :=== )
140- allow ( mock_store_klass ) . to receive ( :mock_store ) do
141- @mock_store ||= Hash . new { | h , k | h [ k ] = [ ] }
139+ allow ( model_class ) . to receive ( :__rspec_mocks ) do
140+ @__rspec_mocks ||= [ ]
142141 end
143142 allow ( model_class ) . to receive ( :=== ) . and_wrap_original do |original , other |
144- mock_store_klass . mock_store [ model_class ] . any? { | ms | ms === other } || original . call ( other )
143+ model_class . __rspec_mocks . include? ( other ) || original . call ( other )
145144 end
146145 end
147- mock_store_klass . mock_store [ model_class ] << m if mock_store_klass . respond_to? ( :mock_store )
146+ model_class . __rspec_mocks << m if model_class . respond_to? ( :__rspec_mocks )
148147 msingleton = class << m ; self ; end
149148 msingleton . class_eval do
150149 include ActiveModelInstanceMethods
You can’t perform that action at this time.
0 commit comments