Sha256: d35f7a7354631f08b47b175794799c66ecc8c8df56a4f8a9bd6c8f2bba5b0acd

Contents?: true

Size: 1006 Bytes

Versions: 5

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

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

class CoverbandTest < Test::Unit::TestCase

  test 'Coverband#start kicks off background reporting if enabled and not in rack server' do
    Coverband.configuration.stubs(:background_reporting_enabled).returns(:true)
    Coverband::RackServerCheck.expects(:running?).returns(false)
    Coverband::Background.expects(:start)
    Coverband.start
  end

  test 'Coverband#start delays background reporting if enabled and running in a rack server' do
    Coverband.configuration.stubs(:background_reporting_enabled).returns(true)
    Coverband::RackServerCheck.expects(:running?).returns(true)
    Coverband::Background.expects(:start).never
    Coverband.start
  end

  test 'Coverband#start does not kick off background reporting if not enabled' do
    Coverband.configuration.stubs(:background_reporting_enabled).returns(false)
    Coverband::Background.expects(:start).never
    ::Coverband.start
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
coverband-4.0.1.alpha test/unit/coverband_test.rb
coverband-4.0.0 test/unit/coverband_test.rb
coverband-4.0.0.alpha test/unit/coverband_test.rb
coverband-3.0.1 test/unit/coverband_test.rb
coverband-3.0.1.alpha test/unit/coverband_test.rb