Class: Tending::TendingReport

Inherits:
Object
  • Object
show all
Defined in:
lib/tending/tending_report.rb

Overview

class used to renerate reports of pending tests

Instance Method Summary collapse

Constructor Details

#initialize(pattern) ⇒ TendingReport

Returns a new instance of TendingReport.

Raises:

  • (ArgumentError)


8
9
10
11
12
# File 'lib/tending/tending_report.rb', line 8

def initialize(pattern)
  raise ArgumentError unless pattern.kind_of? String
  
  @pattern = pattern
end

Instance Method Details

#reportObject

generate report based on pattern



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/tending/tending_report.rb', line 15

def report
  Dir.glob(@pattern) do |file|
    unless require file
      load file
    end
  end
  
  report_string = "\nPending Tests:\n"
  
  Test::Unit::TestCase.pending_tests.each do |file,pending_tests|
    report_string += "In #{file}:\n"
    pending_tests.each do |pending_test|
      report_string += "  #{pending_test}\n"
    end
  end
  
  report_string + "\n"
end