-
-
Save anonymous/fdb0907fcae297006f92 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
require 'spec_helper' | |
class ProcessLogFiles | |
def start | |
# for log in logfiles | |
LogFile.new.process #log | |
# end | |
end | |
end | |
class LogFile | |
def process | |
# for line in log | |
# if some condition is met | |
LogMail.new.send # or some other meth with no side-effect | |
# end | |
# end | |
end | |
end | |
class LogMail | |
def send | |
end | |
end | |
describe "testing nest" do | |
it "should show that a function was called" do | |
LogMail.any_instance.stubs(:send).runs { $ran_meth = true } | |
ProcessLogFiles.new.start | |
$ran_meth.should == true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment