class DatabasePlumber::Report
Public Class Methods
on(example, leaks)
click to toggle source
# File lib/database_plumber/report.rb, line 5 def self.on(example, leaks) puts <<-REPORT.strip_heredoc #{HighLine.color('#### Leaking Test', :red)} The spec '#{HighLine.color(spec_path_for(example), :red, :underline)}' leaves the following rows in the database: REPORT leaks.each(&method(:print_leak)) puts <<-REPORT.strip_heredoc #{HighLine.color('#### What now?', :yellow)} If you are using #{HighLine.color('let!', :yellow)} or #{HighLine.color('before(:all)', :yellow)} please ensure that you use a corresponding #{HighLine.color('after(:all)', :yellow)} block to clean up these rows. REPORT end
Private Class Methods
print_leak(model, count)
click to toggle source
# File lib/database_plumber/report.rb, line 27 def self.print_leak(model, count) puts " - #{HighLine.color(count.to_s, :blue)} row(s) for the #{model} model \n" end
spec_path_for(example)
click to toggle source
# File lib/database_plumber/report.rb, line 31 def self.spec_path_for(example) example.metadata[:example_group][:file_path] end