# File lib/flexmock/mock_container.rb, line 212
212:     def add_model_methods(mock, model_class, id)
213:       container = mock.flexmock_container
214: 
215:       mock_errors = container.flexmock("errors")
216:       mock_errors.should_receive(:count).and_return(0).by_default
217:       mock_errors.should_receive(:full_messages).and_return([]).by_default
218: 
219:       mock.should_receive(:id).and_return(id).by_default
220:       mock.should_receive(:to_params).and_return(id.to_s).by_default
221:       mock.should_receive(:new_record?).and_return(false).by_default
222:       mock.should_receive(:class).and_return(model_class).by_default
223:       mock.should_receive(:errors).and_return(mock_errors).by_default
224: 
225:       # HACK: Ruby 1.9 needs the following lambda so that model_class
226:       # is correctly bound below.
227:       lambda { }
228:       mock.should_receive(:is_a?).with(any).and_return { |other|
229:         other == model_class
230:       }.by_default
231:       mock.should_receive(:instance_of?).with(any).and_return { |other|
232:         other == model_class
233:       }.by_default
234:       mock.should_receive(:kind_of?).with(any).and_return { |other|
235:         model_class.ancestors.include?(other)
236:       }.by_default
237:     end