Poetry of Programming

Its about Ruby on Rails – Kiran Soumya

By

Rspec to work with Logger

In order to set expectations on what we actually logged during the method call,assign under before(:each)

@test_logger = StringIO.new

controller.stub!(:logger).and_return(Logger.new(@test_logger))

and then match the log output using @test_logger.string

Leave a Reply

Your email address will not be published. Required fields are marked *