Created
August 30, 2011 19:37
-
-
Save steveburkett/1181807 to your computer and use it in GitHub Desktop.
mock example
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
it "should lookup by last_updated for abc files" do | |
update_time = Time.now | |
# create a location to match this update_time here | |
file = double("file") | |
file.should_receive(:extension).and_return("abc") | |
file.should_receive(:last_update).and_return(update_time) | |
MyClass.load_file(file).should == Location.find_by_lookup(update_time) | |
end | |
it "should lookup by extension for all other files" do | |
# create a location to match the "def" extension here | |
file = double("file") | |
file.should_receive(:extension).twice.and_return("def") | |
file.should_not_receive(:last_update) | |
MyClass.load_file(file).should == Location.find_by_lookup("def") | |
end |
Lol, maybe they can all sing kumbaya around a camp fire too. I've got to make some time for Ruby soon, but JS and java both keep getting in the way. Oh well.
I have fond memories of singing kumbaya around a campfire
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yes, this is why Ruby is "test mad". My comment on 80/20 was more the amount of emphasis on testing behaviors vs emphasis on test coverage (w/ legacy code). When u r doing TDD, like you said, you're getting great test coverage by default. I hope all the language worlds can get together and help learn from each other rather than laugh at piteousness.