Class: PercentageFormatter

Inherits:
RSpec::Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/percentage_formatter.rb,
lib/percentage_formatter/output.rb

Defined Under Namespace

Classes: Output

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ PercentageFormatter

Returns a new instance of PercentageFormatter.



9
10
11
12
13
# File 'lib/percentage_formatter.rb', line 9

def initialize(output)
  super

  self.outputter = PercentageFormatter::Output.new(output)
end

Instance Attribute Details

#outputterObject

Returns the value of attribute outputter.



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

def outputter
  @outputter
end

Instance Method Details

#example_failed(notification) ⇒ Object



25
26
27
# File 'lib/percentage_formatter.rb', line 25

def example_failed(notification)
  outputter.failure(notification)
end

#example_started(notification) ⇒ Object



21
22
23
# File 'lib/percentage_formatter.rb', line 21

def example_started(notification)
  outputter.increment
end

#start(notification) ⇒ Object



15
16
17
18
19
# File 'lib/percentage_formatter.rb', line 15

def start(notification)
  super

  outputter.start(notification.count)
end