Ruby on Rails Friday, November 30, 2012

I am trying to debug a database adapter for active record, and I have a
case where it spits back after all tests have run a partial error
message with no context at all.

For example:

Exception raised:
<#<ActiveRecord::StatementInvalid: NoMethodError: undefined method `[]'
for nil:NilClass: INSERT INTO `subscribers` (`books_count`, `name`,
`nick`) VALUES (?, ?, ?)>>.

It would be nice if the test framework for rails AT LEAST spit out the
line where this happened.

So, without any useful information from the test suite, what I wanted to
do was to find out blow by blow when bad things happen so I can
correlate it to the step-wise actions in a debugger, and so trace WHERE
the bad thing is happening. But no, the test suite eats all STDOUT and
only spits it out after all tests have completed.

Does anyone know how to get Rails to emit all stdout immediately instead
of buffering it until after ALL tests have completed?


Posted via

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit

No comments:

Post a Comment