opensoul.org

Using breakpointer to debug rails tests

I played with breakpointer for a few minutes to check it out when I was first learning Rails, but I’ve never actually used it for serious debugging. But yesterday I had a unit test that was failing and I could not figure why, so I decided I would try it out. I discovered that breakpointer works really well for debugging tests! I had only used it in the context of debugging actions.

Using the breakpointer is really easy, just insert breakpoint at any point in your code. When you run your tests, it will open up an irb session whenever it encounters a breakpoint in your code.

.....Executing break point at ./test/unit/event_test.rb:36 in `test_duration'
irb(test_duration_with_hash=(EventTest)):001:0>

rails and testing July 19, 2006

Post a Comment

Comments use textile. Anonymous comments will be deleted.

My name is Brandon Keepers. I like to build things, usually in Ruby or JavaScript. I work at GitHub and live in Holland, MI.

Popular Posts