Created
May 8, 2014 00:38
-
-
Save gabrieljoelc/09587467e26ee6b6ece3 to your computer and use it in GitHub Desktop.
From http://blog.arvidandersson.se/2012/03/28/minimalicous-testing-in-ruby-1-9: "Partial stubbing is when you want use a “real object” in your tests but want to stub some of the methods of that object, for example to avoid hitting the network or to freeze the time. These kinds of stubs are easily added in ruby thanks to it's dynamic workings. Le…
This file contains hidden or 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
describe Book do | |
it "glorifies published at" do | |
book = Book.new | |
def book.published_at | |
Time.new(2012, 1, 2) | |
end | |
book.glorified_published_at.must_equal "The most awesome and first Monday of the glorious year of 2012" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment