Skip to content

Instantly share code, notes, and snippets.

View kaiwren's full-sized avatar

Sidu Ponnappa kaiwren

View GitHub Profile
@kaiwren
kaiwren / gist:562205
Created September 2, 2010 12:14 — forked from anonymous/works
class Resource
end
class Record
end
@resource = mock(Resource, :id => '1')
Resource.stub!(:find).and_return([@resource]) # works
Record.stub!(:serialize).and_return(true)
@record = mock(Record, :id => '1', :resource_ids => [1], :current_language => 'de') # fails later with:
# undefined method `serialize' for Spec::Mocks::Mock:Class