Class: DatabasePlumber::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/database_plumber/report.rb

Class Method Summary collapse

Class Method Details

.on(example, leaks) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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