Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Commit 33c669c

Browse files
author
Brian Butz
committed
rspec metadata tag to show db queries in logs
1 parent 4ca08f1 commit 33c669c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@
134134
@uaa_server.stop
135135
end
136136

137+
rspec_config.before(:example, :log_db) do
138+
db = DbConfig.new.connection
139+
db.loggers << Logger.new($stdout)
140+
db.sql_log_level = :info
141+
end
142+
137143
rspec_config.example_status_persistence_file_path = 'spec/examples.txt'
138144
rspec_config.expose_current_running_example_as :example # Can be removed when we upgrade to rspec 3
139145

0 commit comments

Comments
 (0)