Sha256: 447259823a8903604e077ace3c555767c67d6e6b0a680693a993d6834aa4b45f

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

require 'rspec/core/formatters/base_text_formatter'

module RspecProgressBar
  class Formatter < RSpec::Core::Formatters::BaseTextFormatter
    RSpec::Core::Formatters.register self, :start, :example_started

    attr_accessor :progress_bar

    def start(notification)
      @progress_bar = ProgressBar.new(notification.count)
    end

    def example_started(_notification)
      progress_bar.count += 1
      output << "\r#{progress_bar}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-progress-bar-0.1.2 lib/rspec_progress_bar/formatter.rb