Class: RSpec::Longrun::Formatter

Inherits:
Core::Formatters::BaseTextFormatter
  • Object
show all
Defined in:
lib/rspec/longrun/formatter.rb

Defined Under Namespace

Classes: Block

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Formatter

Returns a new instance of Formatter.



14
15
16
17
# File 'lib/rspec/longrun/formatter.rb', line 14

def initialize(output)
  super(output)
  @blocks = [Block.new(true)]
end

Instance Method Details

#example_failed(notification) ⇒ Object



43
44
45
# File 'lib/rspec/longrun/formatter.rb', line 43

def example_failed(notification)
  end_block(wrap("FAILED", :failure))
end

#example_group_finished(notification) ⇒ Object



27
28
29
# File 'lib/rspec/longrun/formatter.rb', line 27

def example_group_finished(notification)
  end_block
end

#example_group_started(notification) ⇒ Object



23
24
25
# File 'lib/rspec/longrun/formatter.rb', line 23

def example_group_started(notification)
  begin_block(notification.group.description)
end

#example_passed(notification) ⇒ Object



35
36
37
# File 'lib/rspec/longrun/formatter.rb', line 35

def example_passed(notification)
  end_block(wrap("OK", :success))
end

#example_pending(notification) ⇒ Object



39
40
41
# File 'lib/rspec/longrun/formatter.rb', line 39

def example_pending(notification)
  end_block(wrap("PENDING: " + notification.example.execution_result.pending_message, :pending))
end

#example_started(notification) ⇒ Object



31
32
33
# File 'lib/rspec/longrun/formatter.rb', line 31

def example_started(notification)
  begin_block(wrap(notification.example.description, :detail))
end

#start(notification) ⇒ Object



19
20
21
# File 'lib/rspec/longrun/formatter.rb', line 19

def start(notification)
  Thread.current["rspec.longrun.formatter"] = self
end

#step_errored(e) ⇒ Object



55
56
57
# File 'lib/rspec/longrun/formatter.rb', line 55

def step_errored(e)
  end_block(wrap("", :failure))
end

#step_finishedObject



51
52
53
# File 'lib/rspec/longrun/formatter.rb', line 51

def step_finished
  end_block(wrap("", :success))
end

#step_started(description) ⇒ Object



47
48
49
# File 'lib/rspec/longrun/formatter.rb', line 47

def step_started(description)
  begin_block(description)
end