Sha256: 3c47a624983037797eb7fd529b1a1c2e2da9e03a76b0656e671c924b120f710b

Contents?: true

Size: 1.49 KB

Versions: 49

Compression:

Stored size: 1.49 KB

Contents

# frozen_string_literal: true

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

class CoverbandTest < Minitest::Test
  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

  test "Coverband#configured? works" do
    Coverband.configure
    assert Coverband.configured?
  end

  test "Eager load coverage block" do
    Coverband.eager_loading_coverage do
      # some code
      1 + 1
    end
    assert_equal :runtime, Coverband.configuration.store.type
  end

  test "Eager load coverage" do
    Coverband.eager_loading_coverage!
    assert_equal :eager_loading, Coverband.configuration.store.type
    Coverband.runtime_coverage!
    assert_equal :runtime, Coverband.configuration.store.type
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
coverband-6.1.4 test/coverband/coverband_test.rb
coverband-6.1.3 test/coverband/coverband_test.rb
coverband-6.1.2 test/coverband/coverband_test.rb
coverband-6.1.2.rc.1 test/coverband/coverband_test.rb
coverband-6.1.1 test/coverband/coverband_test.rb
coverband-6.1.0 test/coverband/coverband_test.rb
coverband-6.0.3.rc.4 test/coverband/coverband_test.rb
coverband-6.0.3.rc.3 test/coverband/coverband_test.rb
coverband-6.0.3.rc.2 test/coverband/coverband_test.rb
coverband-6.0.3.rc.1 test/coverband/coverband_test.rb
coverband-6.0.2 test/coverband/coverband_test.rb
coverband-6.0.1 test/coverband/coverband_test.rb
coverband-6.0.1.rc.1 test/coverband/coverband_test.rb
coverband-6.0.0 test/coverband/coverband_test.rb
coverband-5.2.6.rc.6 test/coverband/coverband_test.rb
coverband-5.2.3.2 test/coverband/coverband_test.rb
coverband-5.2.6.rc.5 test/coverband/coverband_test.rb
coverband-5.2.3.1 test/coverband/coverband_test.rb
coverband-5.2.6.rc.4 test/coverband/coverband_test.rb
coverband-5.2.6.rc.3 test/coverband/coverband_test.rb