# File lib/flexmock/mock_container.rb, line 222
222:     def add_model_methods(mock, model_class, id)
223:       container = mock.flexmock_container
224: 
225:       mock_errors = container.flexmock("errors")
226:       mock_errors.should_receive(:count).and_return(0).by_default
227:       mock_errors.should_receive(:full_messages).and_return([]).by_default
228: 
229:       mock.should_receive(:id).and_return(id).by_default
230:       mock.should_receive(:to_params).and_return(id.to_s).by_default
231:       mock.should_receive(:new_record?).and_return(false).by_default
232:       mock.should_receive(:class).and_return(model_class).by_default
233:       mock.should_receive(:errors).and_return(mock_errors).by_default
234: 
235:       # HACK: Ruby 1.9 needs the following lambda so that model_class
236:       # is correctly bound below.
237:       lambda { }
238:       mock.should_receive(:is_a?).with(any).and_return { |other|
239:         other == model_class
240:       }.by_default
241:       mock.should_receive(:instance_of?).with(any).and_return { |other|
242:         other == model_class
243:       }.by_default
244:       mock.should_receive(:kind_of?).with(any).and_return { |other|
245:         model_class.ancestors.include?(other)
246:       }.by_default
247:     end