Created
January 12, 2015 13:28
-
-
Save yorickpeterse/f3c854e13b3bd27c17cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The contents of this block would be arbitrary, it's _not_ tied into any ORM/database/etc. | |
define_dummy(:stubbed_user) do |attrs| | |
user = User.new(attrs) | |
user.stub(:something).and_return('foo') | |
user | |
end | |
describe User do | |
describe '#something' do | |
it 'returns something' do | |
user = dummy(:stubbed_user, :name => 'Alice') | |
# ... | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment