Created
May 18, 2011 21:46
-
-
Save pellegrino/979642 to your computer and use it in GitHub Desktop.
when to mock or not to mock?
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
| module RubyAck | |
| class Invoker | |
| def invoke(ack_string) | |
| IO.popen("ack #{ack_string} --column") { |io| io.readlines } | |
| end | |
| end | |
| end |
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 RubyAck::Invoker do | |
| it "should invoke ack with --column as a default for the given parameter" do | |
| IO.should_receive(:popen).with("ack jackpot --column") | |
| invoker = RubyAck::Invoker.new | |
| invoker.invoke("jackpot") | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment