RSpec::Support.require_rspec_core "formatters/base_text_formatter"
RSpec::Support.require_rspec_core "formatters/exception_presenter"
require './core/utils/bmp_utils'

module BMPFormatter
  class Formatter
    RSpec::Core::Formatters.register self, :example_started, :close

    include BmpUtils

    def initialize(output)
      # This is needed for the rspec formatter to register
      @@proxy = get_proxy
    end

    def example_started(notification)
      @@proxy.new_har
    end

    def close(nullnotification)
      @@proxy.close_proxy
    end
  end
end
