Sha256: 32088011bf171ab12d300ac9f4ca70561715e3e66e533973517922a7db83738e

Contents?: true

Size: 869 Bytes

Versions: 3

Compression:

Stored size: 869 Bytes

Contents

# frozen_string_literal: true

require File.expand_path('../test_helper', File.dirname(__FILE__))

class SimpleCovReportTest < Test::Unit::TestCase
  BASE_KEY = Coverband::Adapters::RedisStore::BASE_KEY

  def setup
    @redis = Redis.new
    @store = Coverband::Adapters::RedisStore.new(@redis)
    @store.clear!
  end

  test 'report data' do
    Coverband.configure do |config|
      config.reporter            = 'std_out'
      config.store               = @store
      config.reporting_frequency = 100.0
    end
    Coverband.configuration.logger.stubs('info')
    Coverband::Reporters::ConsoleReport
      .expects(:current_root)
      .returns('app_path')
    @store.send(:save_report, basic_coverage)

    report = Coverband::Reporters::ConsoleReport.report(@store)
    expected = { 'app_path/dog.rb' => [0, 1, 2] }
    assert_equal(expected, report)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coverband-3.0.0 test/unit/reports_console_test.rb
coverband-3.0.0.alpha2 test/unit/reports_console_test.rb
coverband-3.0.0.alpha test/unit/reports_console_test.rb