Class: TestAlignCentaur

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

Instance Method Summary collapse

Instance Method Details

#example_failed(example) ⇒ Object



29
30
31
32
# File 'lib/test_align_centaur.rb', line 29

def example_failed(example)
  super(example)
  print red('F')
end

#example_passed(example) ⇒ Object



19
20
21
22
# File 'lib/test_align_centaur.rb', line 19

def example_passed(example)
  super(example)
  print green('.')
end

#example_pending(example) ⇒ Object



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

def example_pending(example)
  super(example)
  print yellow('*')
end


6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/test_align_centaur.rb', line 6

def print(arg)
  if @centaur.nil?
    @centaur = String::CENTAUR.chomp
  elsif @centaur.empty?
    @centaur = "\n" + String::CENTAUR.chomp
  end
  while char = @centaur.slice!(0)
    break if char == 'x'
    output.print(char)
  end
  output.print(arg)
end

#start_dumpObject



34
35
36
37
# File 'lib/test_align_centaur.rb', line 34

def start_dump
  super()
  output.puts
end