Logging database queries in unit tests - cloudfoundry/cloud_controller_ng GitHub Wiki
Sometimes you wanna see what Sequel is up to when you're SELECTing, FROMing, and/or WHEREing in your unit tests. The logs for all your unit tests appear in spec/artifacts/spec.log. You may want to delete this periodically as it is appended to and can get quite large!
To set up db query logging:
- Open
spec/support/bootstrap/db_config.rband addlog_db_queries: true,to the hash returned by theconfigmethod - Run your test, and
tail -forlessor whateverspec/artifacts/spec.log - There's no step 3