In Files

Parent

Class/Module Index [+]

Quicksearch

Fuubar

Attributes

example_count[R]
finished_count[R]

Public Instance Methods

colors() click to toggle source
# File lib/fuubar.rb, line 68
def colors
  { :red => 31, :green => 32, :yellow => 33 }
end
dump_failures() click to toggle source
# File lib/fuubar.rb, line 50
def dump_failures
  # don't!
end
example_failed(example) click to toggle source
# File lib/fuubar.rb, line 35
def example_failed(example)
  super
  @state = :red

  output.print "\e[K"
  instafail.example_failed(example)
  output.puts

  increment
end
example_passed(example) click to toggle source
# File lib/fuubar.rb, line 24
def example_passed(example)
  super
  increment
end
example_pending(example) click to toggle source
# File lib/fuubar.rb, line 29
def example_pending(example)
  super
  @state = :yellow unless @state == :red
  increment
end
increment() click to toggle source
# File lib/fuubar.rb, line 16
def increment
  with_color do
    @finished_count += 1
    @progress_bar.instance_variable_set("@title", "  #{finished_count}/#{example_count}")
    @progress_bar.inc
  end
end
instafail() click to toggle source
# File lib/fuubar.rb, line 54
def instafail
  @instafail ||= RSpec::Instafail.new(output)
end
start(example_count) click to toggle source
# File lib/fuubar.rb, line 9
def start(example_count)
  @example_count = example_count
  @finished_count = 0
  @progress_bar = ProgressBar.new("  #{example_count} examples", example_count, output)
  @progress_bar.bar_mark = '='
end
start_dump() click to toggle source
# File lib/fuubar.rb, line 46
def start_dump
  with_color { @progress_bar.finish }
end
state() click to toggle source
# File lib/fuubar.rb, line 64
def state
  @state ||= :green
end
with_color() click to toggle source
# File lib/fuubar.rb, line 58
def with_color
  output.print "\e[#{colors[state]}m" if color_enabled?
  yield
  output.print "\e[0m"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.