Class: Synthesis::Formatter

Inherits:
Object show all
Defined in:
lib/synthesis/formatter.rb

Direct Known Subclasses

DotFormatter, TextFormatter

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(out) ⇒ Formatter

Returns a new instance of Formatter.



3
4
5
# File 'lib/synthesis/formatter.rb', line 3

def initialize(out)
  @out = out
end

Class Method Details

.inherited(subclass) ⇒ Object



20
21
22
# File 'lib/synthesis/formatter.rb', line 20

def inherited(subclass)
  @formatter = subclass
end

.load(out) ⇒ Object



16
17
18
# File 'lib/synthesis/formatter.rb', line 16

def load(out)
  @formatter.new(out)
end

Instance Method Details

#report_tested_expectationsObject



7
8
9
# File 'lib/synthesis/formatter.rb', line 7

def report_tested_expectations
  ExpectationRecord.tested_expectations.each { |e| @out.puts e.to_report }
end

#report_untested_expectationsObject



11
12
13
# File 'lib/synthesis/formatter.rb', line 11

def report_untested_expectations
  ExpectationRecord.untested_expectations.each { |e| @out.puts e.to_report }
end