Our company just had an interesting conversation around mock_model and I want to ask the same question to this audience. When creating mock_models what is the purpose of passing in the class constant?

user = mock_model(User)

To the best that we can tell the method mock_model doesn't actually use the class for anything. Please correct us if we are wrong. Secondly, we also typically after a mock_model stub the necessary properties (attributes) that are accessed off of the model. For example ....

user = mock_model(User)

user.stub!(:username) ...
user.stub!(:password) ....

Why doesn't mock model interrogate the attributes and generate these mocks for me? Thanks for taking the time to answer.

Anthony Broad-Crawford



_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to