Verifying doubles allows you to ensure that you're not mocking up attributes and methods that don't exist on the mocked class.
rspec-activemodel-mocks should support verifying doubles when using mock_model. I was able to enable it by simply changing:
|
double("#{model_class.name}_#{stubs[:id]}", stubs).tap do |m| |
double("#{model_class.name}_#{stubs[:id]}", stubs).tap do |m|
to
instance_double(model_class, stubs).tap do |m|
This works great for how I'm using this gem, but I suspect it might break things for other users, for example if mock_model was passed "A String representing a Class that does not exist" (?)
I would be happy to work on a PR if given some advice on how to proceed.
Verifying doubles allows you to ensure that you're not mocking up attributes and methods that don't exist on the mocked class.
rspec-activemodel-mocks should support verifying doubles when using
mock_model. I was able to enable it by simply changing:rspec-activemodel-mocks/lib/rspec/active_model/mocks/mocks.rb
Line 121 in f5f8165
to
This works great for how I'm using this gem, but I suspect it might break things for other users, for example if
mock_modelwas passed "A String representing a Class that does not exist" (?)I would be happy to work on a PR if given some advice on how to proceed.