repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails_test_helper.rb | test/rails_test_helper.rb | # frozen_string_literal: true
require "minitest"
require "minitest/fork_executor"
# Forked executor includes autorun which does not work with qrush/m
# https://github.com/qrush/m/issues/26
# https://github.com/seattlerb/minitest/blob/master/lib/minitest/autorun.rb
if defined?(M)
Minitest.class_eval do
def self.... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/benchmarks/dog.rb | test/benchmarks/dog.rb | # frozen_string_literal: true
class Dog
def bark
"bark"
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/integration/full_stack_send_deferred_eager_test.rb | test/integration/full_stack_send_deferred_eager_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
require "rack"
class FullStackSendDeferredEagerTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
TEST_RACK_APP = "../fake_app/basic_rack.rb"
def setu... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/integration/full_stack_deferred_eager_test.rb | test/integration/full_stack_deferred_eager_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
require "rack"
class FullStackDeferredEagerTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
TEST_RACK_APP = "../fake_app/basic_rack.rb"
def setup
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/integration/full_stack_test.rb | test/integration/full_stack_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
require "rack"
class FullStackTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
TEST_RACK_APP = "../fake_app/basic_rack.rb"
def setup
super
C... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/skipped_and_executed.rb | test/fixtures/skipped_and_executed.rb | # So much skippping
# :nocov:
class Foo
def bar
0
end
end
# :nocov:
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/sample.rb | test/fixtures/sample.rb | # Foo class
class Foo
def initialize
@foo = "baz"
end
def bar
@foo
end
# :nocov:
def skipped
@foo * 2
end
# :nocov:
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/never.rb | test/fixtures/never.rb | # This class is purely some
# comments
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/casting_invitor.rb | test/fixtures/casting_invitor.rb | class CastingInviter
EMAIL_REGEX = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/
attr_reader :message, :invitees, :casting
def initialize(attributes = {})
@message = attributes[:message] || ""
@invitees = attributes[:invitees] || ""
@sender = attributes[:sender]
@casting = attributes[:casting]
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/utf-8.rb | test/fixtures/utf-8.rb | puts "135°C"
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/skipped.rb | test/fixtures/skipped.rb | # Not relevant
# :nocov:
# Hash.new
# :nocov:
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/app/controllers/sample_controller.rb | test/fixtures/app/controllers/sample_controller.rb | # Foo class
class Foo
def initialize
@foo = "baz"
end
def bar
@foo
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fixtures/app/models/user.rb | test/fixtures/app/models/user.rb | # Foo class
class Foo
def initialize
@foo = "baz"
end
def bar
@foo
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/app/controllers/dummy_view_controller.rb | test/rails8_dummy/app/controllers/dummy_view_controller.rb | class DummyViewController < ActionController::Base
def show
@text = "I am no dummy view tracker text"
render layout: false
end
def show_haml
@text = "I am haml text"
render layout: false
end
def show_slim
@text = "I am slim text"
render layout: false
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/app/controllers/dummy_controller.rb | test/rails8_dummy/app/controllers/dummy_controller.rb | class DummyController < ActionController::Base
def show
render plain: "I am no dummy"
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/application.rb | test/rails8_dummy/config/application.rb | # frozen_string_literal: true
require File.expand_path("boot", __dir__)
require "rails"
require "action_controller/railtie"
require "coverband"
Bundler.require(*Rails.groups)
module Rails6Dummy
class Application < Rails::Application
config.eager_load = true
config.consider_all_requests_local = true
end
e... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/environment.rb | test/rails8_dummy/config/environment.rb | # Load the Rails application.
require File.expand_path("../application", __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/routes.rb | test/rails8_dummy/config/routes.rb | Rails.application.routes.draw do
get "dummy/show"
get "dummy_view/show", to: "dummy_view#show"
get "dummy_view/show_haml", to: "dummy_view#show_haml"
get "dummy_view/show_slim", to: "dummy_view#show_slim"
mount Coverband::Reporters::Web.new, at: "/coverage"
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/coverband.rb | test/rails8_dummy/config/coverband.rb | # frozen_string_literal: true
require_relative "../../rails7_dummy/config/coverband"
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/coverband_missing_redis.rb | test/rails8_dummy/config/coverband_missing_redis.rb | # frozen_string_literal: true
require_relative "../../rails7_dummy/config/coverband_missing_redis"
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails8_dummy/config/boot.rb | test/rails8_dummy/config/boot.rb | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
require "bundler/setup" # Set up gems listed in the Gemfile.
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/forked/rails_rake_full_stack_test.rb | test/forked/rails_rake_full_stack_test.rb | # frozen_string_literal: true
require File.expand_path("../rails_test_helper", File.dirname(__FILE__))
require "rails"
class RailsRakeFullStackTest < Minitest::Test
def setup
super
Coverband.configuration.reset
Coverband.configure("./test/rails#{Rails::VERSION::MAJOR}_dummy/config/coverband.rb")
end
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/forked/rails_full_stack_test.rb | test/forked/rails_full_stack_test.rb | # frozen_string_literal: true
require File.expand_path("../rails_test_helper", File.dirname(__FILE__))
class RailsFullStackTest < Minitest::Test
include Capybara::DSL
include Capybara::Minitest::Assertions
def setup
super
rails_setup
# preload first coverage hit
Coverband.report_coverage
re... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/forked/rails_route_tracker_stack_test.rb | test/forked/rails_route_tracker_stack_test.rb | # frozen_string_literal: true
require File.expand_path("../rails_test_helper", File.dirname(__FILE__))
class RailsRoutesWithoutConfigStackTest < Minitest::Test
def setup
super
setup_server
end
def teardown
super
shutdown_server
end
test "check route tracker" do
output = `sleep 7 && cur... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/forked/rails_full_stack_views_test.rb | test/forked/rails_full_stack_views_test.rb | # frozen_string_literal: true
require File.expand_path("../rails_test_helper", File.dirname(__FILE__))
class RailsFullStackTest < Minitest::Test
include Capybara::DSL
include Capybara::Minitest::Assertions
def setup
super
rails_setup
Coverband.report_coverage
end
def teardown
super
Cap... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/forked/rails_view_tracker_stack_test.rb | test/forked/rails_view_tracker_stack_test.rb | # frozen_string_literal: true
require File.expand_path("../rails_test_helper", File.dirname(__FILE__))
class RailsWithoutConfigStackTest < Minitest::Test
def setup
super
setup_server
end
def teardown
super
shutdown_server
end
test "check view tracker" do
output = `sleep 7 && curl http:... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/app/controllers/dummy_view_controller.rb | test/rails7_dummy/app/controllers/dummy_view_controller.rb | class DummyViewController < ActionController::Base
def show
@text = "I am no dummy view tracker text"
render layout: false
end
def show_haml
@text = "I am haml text"
render layout: false
end
def show_slim
@text = "I am slim text"
render layout: false
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/app/controllers/dummy_controller.rb | test/rails7_dummy/app/controllers/dummy_controller.rb | class DummyController < ActionController::Base
def show
render plain: "I am no dummy"
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/application.rb | test/rails7_dummy/config/application.rb | # frozen_string_literal: true
require File.expand_path("boot", __dir__)
require "rails"
require "action_controller/railtie"
require "coverband"
Bundler.require(*Rails.groups)
module Rails6Dummy
class Application < Rails::Application
config.eager_load = true
config.consider_all_requests_local = true
end
e... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/environment.rb | test/rails7_dummy/config/environment.rb | # Load the Rails application.
require File.expand_path("../application", __FILE__)
# Initialize the Rails application.
Rails.application.initialize!
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/routes.rb | test/rails7_dummy/config/routes.rb | Rails.application.routes.draw do
get "dummy/show"
get "dummy_view/show", to: "dummy_view#show"
get "dummy_view/show_haml", to: "dummy_view#show_haml"
get "dummy_view/show_slim", to: "dummy_view#show_slim"
mount Coverband::Reporters::Web.new, at: "/coverage"
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/coverband.rb | test/rails7_dummy/config/coverband.rb | # frozen_string_literal: true
Coverband.configure do |config|
# NOTE: we reuse this config in each of the fake rails projects
# the below ensures the root is set to the correct fake project
config.root = ::File.expand_path("../../../", __FILE__).to_s + "/rails#{Rails::VERSION::MAJOR}_dummy"
config.store = Cove... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/coverband_missing_redis.rb | test/rails7_dummy/config/coverband_missing_redis.rb | # frozen_string_literal: true
Coverband.configure do |config|
config.root = Dir.pwd
config.store = Coverband::Adapters::RedisStore.new(Redis.new(db: 2, url: "redis://127.0.0.1:123"), redis_namespace: "coverband_test") if defined? Redis
config.ignore = %w[vendor .erb$ .slim$]
config.root_paths = []
config.log... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/rails7_dummy/config/boot.rb | test/rails7_dummy/config/boot.rb | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
require "bundler/setup" # Set up gems listed in the Gemfile.
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/fake_app/basic_rack.rb | test/fake_app/basic_rack.rb | # frozen_string_literal: true
require "rack"
class HelloWorld
def call(_env)
[200, {"content-type" => "text/html"}, "Hello Rack!"]
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/track_key_test.rb | test/coverband/track_key_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
class TrackKeyTest < Minitest::Test
test "track_key accepts supported tracker types" do
mock_view_tracker = mock
mock_view_tracker.expects(:track_key).with("view/path/index.html.erb").returns(true)
Coverband... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/configuration_test.rb | test/coverband/configuration_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
class BaseTest < Minitest::Test
def setup
Coverband.configuration.reset
super
Coverband.configuration.reset
Coverband.configure do |config|
config.root = Dir.pwd
config.root_paths = ["/app_pa... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/coverband_test.rb | test/coverband/coverband_test.rb | # 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)
Coverban... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/at_exit_test.rb | test/coverband/at_exit_test.rb | # frozen_string_literal: true
require File.expand_path("../test_helper", File.dirname(__FILE__))
class AtExitTest < Minitest::Test
test "only registers once" do
Coverband::AtExit.instance_eval { @at_exit_registered = nil }
Coverband::AtExit.expects(:at_exit).yields.once.returns(true)
2.times { Coverband... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/test_resque_job.rb | test/coverband/integrations/test_resque_job.rb | # frozen_string_literal: true
class TestResqueJob
@queue = :resque_coverband
def self.perform
"resque job perform"
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/resque_worker_test.rb | test/coverband/integrations/resque_worker_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class ResqueWorkerTest < Minitest::Test
# NOTE: It appears there are some bugs in resque for JRUBY, not coverband, so excluding these tests on JRUBY
# if folks hit issues with Coverband and resque this could be a r... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/background_test.rb | test/coverband/integrations/background_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class BackgroundTest < Minitest::Test
class ThreadDouble < Struct.new(:alive)
def exit
end
def alive?
alive
end
end
def setup
Coverband.configuration.reset
super
Coverband.conf... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/report_middleware_test.rb | test/coverband/integrations/report_middleware_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
require "coverband/integrations/report_middleware"
class ReportMiddlewareTest < Minitest::Test
def setup
super
Coverband.configure do |config|
config.background_reporting_enabled = false
end
end
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/background_middleware_test.rb | test/coverband/integrations/background_middleware_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
require "rack"
class BackgroundMiddlewareTest < Minitest::Test
def setup
super
Coverband.configure do |config|
config.background_reporting_enabled = false
end
end
test "call app" do
request... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/integrations/rack_server_check_test.rb | test/coverband/integrations/rack_server_check_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class RackServerCheckTest < Minitest::Test
# Create a Struct for the caller location at the class level
LocationStruct = Struct.new(:path, :label)
test "returns true when running in rack server" do
caller_lo... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/file_hasher_test.rb | test/coverband/utils/file_hasher_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
module Coverband
module Utils
class FileHasherTest < Minitest::Test
def test_hash_same_file
refute_nil FileHasher.hash_file("./test/dog.rb")
assert_equal(FileHasher.hash_file("./test/dog.rb"... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/relative_file_converter_test.rb | test/coverband/utils/relative_file_converter_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
module Coverband
module Utils
class RelativeFileConverterTest < ::Minitest::Test
def test_convert
converter = RelativeFileConverter.new(["/bar/tmp/"])
assert_equal("./gracie.rb", converter.c... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/results_test.rb | test/coverband/utils/results_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
describe "results" do
describe "with a (mocked) Coverage.result" do
let(:source_file) { Coverband::Utils::SourceFile.new(source_fixture("app/models/user.rb"), run_lines) }
let(:eager_lines) { [nil, 1, 1, 0, n... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/lines_classifier_test.rb | test/coverband/utils/lines_classifier_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version of test pulled into Coverband from Simplecov 12/17/2018
####
describe Coverband::Utils::LinesClassifier do
descri... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/method_definition_scanner_test.rb | test/coverband/utils/method_definition_scanner_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
if defined?(RubyVM::AbstractSyntaxTree)
require "coverband/utils/method_definition_scanner"
module Coverband
module Utils
class MethodBodyTest < Minitest::Test
def test_no_method_body_coverage
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/source_file_line_test.rb | test/coverband/utils/source_file_line_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version of test pulled into Coverband from Simplecov 12/19/2018
####
describe Coverband::Utils::SourceFile::Line do
descr... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/file_list_test.rb | test/coverband/utils/file_list_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version of test pulled into Coverband from Simplecov 12/19/2018
####
describe Coverband::Utils::FileList do
subject do
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/absolute_file_converter_test.rb | test/coverband/utils/absolute_file_converter_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
module Coverband
module Utils
class AbsoluteFileConverterTest < ::Minitest::Test
def test_convert
converter = AbsoluteFileConverter.new([FileUtils.pwd])
assert_equal("#{FileUtils.pwd}/lib/co... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/result_test.rb | test/coverband/utils/result_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version of test pulled into Coverband from Simplecov 12/19/2018
####
describe "result" do
describe "with a (mocked) Cover... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/dead_methods_test.rb | test/coverband/utils/dead_methods_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
if defined?(RubyVM::AbstractSyntaxTree)
require "coverband/utils/dead_methods"
module Coverband
module Utils
class DeadMethodsTest < Minitest::Test
attr_accessor :coverband
def setup
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/source_file_test.rb | test/coverband/utils/source_file_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version of test pulled into Coverband from Simplecov 12/19/2018
####
describe Coverband::Utils::SourceFile do
coverage_fo... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/utils/html_formatter_test.rb | test/coverband/utils/html_formatter_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class HTMLFormatterTest < Minitest::Test
def setup
super
@store = Coverband::Adapters::RedisStore.new(Coverband::Test.redis, redis_namespace: "coverband_test")
end
test "generate dynamic content hosted h... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/reporters/json_test.rb | test/coverband/reporters/json_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class ReportJSONTest < Minitest::Test
def setup
super
@store = Coverband.configuration.store
Coverband.configure do |config|
config.store = @store
config.root = fixtures_root
config.igno... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/reporters/web_test.rb | test/coverband/reporters/web_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
require File.expand_path("../../../lib/coverband/reporters/web", File.dirname(__FILE__))
require "rack/test"
ENV["RACK_ENV"] = "test"
module Coverband
class WebTest < Minitest::Test
include Rack::Test::Methods
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/reporters/html_test.rb | test/coverband/reporters/html_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class ReportHTMLTest < Minitest::Test
def setup
super
@store = Coverband.configuration.store
Coverband.configure do |config|
config.store = @store
config.root = fixtures_root
config.igno... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/reporters/console_test.rb | test/coverband/reporters/console_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class HTMLReportTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
def setup
super
@store = Coverband.configuration.store
end
test "repo... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/reporters/base_test.rb | test/coverband/reporters/base_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class ReportsBaseTest < Minitest::Test
def setup
super
end
test "#merge_arrays basic merge preserves order and counts" do
first = [0, 0, 1, 0, 1]
second = [nil, 0, 1, 0, 0]
expects = [0, 0, 2, 0,... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/null_store_test.rb | test/coverband/adapters/null_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class AdaptersNullStoreTest < Minitest::Test
def test_covered_lines_when_no_file
@store = Coverband::Adapters::NullStore.new("")
expected = {}
assert_equal expected, @store.coverage
end
describe "Cov... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/file_store_test.rb | test/coverband/adapters/file_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class AdaptersFileStoreTest < Minitest::Test
def test_covered_lines_when_no_file
@store = Coverband::Adapters::FileStore.new("")
expected = {}
assert_equal expected, @store.coverage
end
describe "Cov... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/hash_redis_store_test.rb | test/coverband/adapters/hash_redis_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class HashRedisStoreTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::HashRedisStore::REDIS_STORAGE_FORMAT_VERSION
class MockRelativeFileConverter
def self.convert(file)
file.sub(... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/redis_store_test.rb | test/coverband/adapters/redis_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
unless ENV["COVERBAND_HASH_REDIS_STORE"]
class RedisTest < Minitest::Test
REDIS_STORAGE_FORMAT_VERSION = Coverband::Adapters::RedisStore::REDIS_STORAGE_FORMAT_VERSION
def setup
super
@store = Cov... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/memecached_store_test.rb | test/coverband/adapters/memecached_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
if ENV["COVERBAND_MEMCACHED"]
require "active_support"
require "dalli"
class MemcachedTest < Minitest::Test
def setup
super
@store = Coverband::Adapters::MemcachedStore.new(ActiveSupport::Cache::... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/base_test.rb | test/coverband/adapters/base_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class AdaptersBaseTest < Minitest::Test
def test_abstract_methods
abstract_methods = %w[clear! clear_file! size save_coverage coverage]
abstract_methods.each do |method|
assert_raises RuntimeError do
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/adapters/web_service_store_test.rb | test/coverband/adapters/web_service_store_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
require File.expand_path("../../../lib/coverband/adapters/web_service_store", File.dirname(__FILE__))
class WebServiceStoreTest < Minitest::Test
COVERBAND_SERVICE_URL = "http://localhost:12345"
FAKE_API_KEY = "1234... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/collectors/delta_test.rb | test/coverband/collectors/delta_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
require "./lib/coverband/collectors/delta"
class CollectorsDeltaTest < Minitest::Test
class MockSystemCoverage < Struct.new(:results)
end
def mock_coverage(coverage)
MockSystemCoverage.new(coverage)
end
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/collectors/translation_tracker_test.rb | test/coverband/collectors/translation_tracker_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class TranslationTrackerTest < Minitest::Test
# NOTE: using struct vs open struct as open struct has a special keyword method that overshadows the method value on Ruby 2.x
Payload = Struct.new(:path, :method)
de... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/collectors/route_tracker_test.rb | test/coverband/collectors/route_tracker_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class RouterTrackerTest < Minitest::Test
# NOTE: using struct vs open struct as open struct has a special keyword method that overshadows the method value on Ruby 2.x
Payload = Struct.new(:path, :method)
def tra... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/collectors/coverage_test.rb | test/coverband/collectors/coverage_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class CollectorsCoverageTest < Minitest::Test
attr_accessor :coverband
def setup
super
@coverband = Coverband::Collectors::Coverage.instance
# preload first coverage hit
@coverband.report_coverage
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/test/coverband/collectors/view_tracker_test.rb | test/coverband/collectors/view_tracker_test.rb | # frozen_string_literal: true
require File.expand_path("../../test_helper", File.dirname(__FILE__))
class ViewTrackerTest < Minitest::Test
def tracker_key
"coverband_test_ViewTracker_tracker"
end
def setup
super
Coverband.configuration.ignore += ["app/views/anything/ignore_me.html.erb"]
fake_st... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband.rb | lib/coverband.rb | # frozen_string_literal: true
require "logger"
require "json"
require "redis"
require "coverband/version"
require "coverband/at_exit"
require "coverband/utils/relative_file_converter"
require "coverband/utils/absolute_file_converter"
require "coverband/adapters/base"
require "coverband/adapters/redis_store"
require "c... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/alternative_coverband_patch.rb | lib/alternative_coverband_patch.rb | # frozen_string_literal: true
module Coverband
COVERBAND_ALTERNATE_PATCH = true
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/version.rb | lib/coverband/version.rb | # frozen_string_literal: true
###
# ensure we properly do release candidate versioning; https://github.com/danmayer/coverband/issues/288
# use format "4.2.1.rc.1" ~> 4.2.1.rc to prerelease versions like v4.2.1.rc.2 and v4.2.1.rc.3
###
module Coverband
VERSION = "6.1.6"
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/at_exit.rb | lib/coverband/at_exit.rb | # frozen_string_literal: true
module Coverband
class AtExit
@semaphore = Mutex.new
@at_exit_registered = nil
def self.register
return if ENV["COVERBAND_DISABLE_AT_EXIT"]
return if @at_exit_registered
@semaphore.synchronize do
return if @at_exit_registered
@at_exit_reg... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/configuration.rb | lib/coverband/configuration.rb | # frozen_string_literal: true
module Coverband
###
# Configuration parsing and options for the coverband gem.
###
class Configuration
attr_accessor :root_paths, :root,
:verbose,
:reporter, :redis_namespace, :redis_ttl,
:background_reporting_enabled,
:test_env, :web_enable_clear, :ge... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/resque.rb | lib/coverband/integrations/resque.rb | # frozen_string_literal: true
Resque.after_fork do |_job|
Coverband.start
Coverband.runtime_coverage!
end
Resque.before_first_fork do
Coverband.eager_loading_coverage!
Coverband.configuration.background_reporting_enabled = false
Coverband::Background.stop
Coverband.report_coverage
end
module Coverband
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/background_middleware.rb | lib/coverband/integrations/background_middleware.rb | # frozen_string_literal: true
module Coverband
class BackgroundMiddleware
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
ensure
AtExit.register
Background.start if Coverband.configuration.background_reporting_enabled
end
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/report_middleware.rb | lib/coverband/integrations/report_middleware.rb | # frozen_string_literal: true
module Coverband
class ReportMiddleware
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
ensure
Collectors::Coverage.instance.report_coverage
end
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/rack_server_check.rb | lib/coverband/integrations/rack_server_check.rb | # frozen_string_literal: true
module Coverband
class RackServerCheck
def self.running?
new(Kernel.caller_locations).running?
end
def initialize(stack)
@stack = stack
end
def running?
rack_server? || rails_server?
end
def rack_server?
@stack.any? { |line| line.pa... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/sidekiq_swarm.rb | lib/coverband/integrations/sidekiq_swarm.rb | # frozen_string_literal: true
Sidekiq.configure_server do |config|
config.on(:fork) do
Coverband.start
Coverband.runtime_coverage!
end
end
| ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/integrations/background.rb | lib/coverband/integrations/background.rb | # frozen_string_literal: true
module Coverband
class Background
@semaphore = Mutex.new
@thread = nil
def self.stop
return unless @thread
@semaphore.synchronize do
if @thread
@thread.exit
@thread = nil
end
end
end
def self.running?
@th... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/jruby_ext.rb | lib/coverband/utils/jruby_ext.rb | # frozen_string_literal: true
####
# This exists in CRuby, but not in JRuby, so add it
#
# Taken from: https://github.com/ruby/ruby/blob/c5eb24349a4535948514fe765c3ddb0628d81004/ext/coverage/lib/coverage.rb
####
module Coverage
def self.line_stub(file)
lines = File.foreach(file).map { nil }
iseqs = [RubyVM::... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/method_definition_scanner.rb | lib/coverband/utils/method_definition_scanner.rb | # frozen_string_literal: true
if defined?(RubyVM::AbstractSyntaxTree)
module Coverband
module Utils
class MethodDefinitionScanner
attr_reader :path
def initialize(path)
@path = path
end
def scan
scan_node(RubyVM::AbstractSyntaxTree.parse_file(path), nil... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/source_file.rb | lib/coverband/utils/source_file.rb | # frozen_string_literal: true
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov
# initial version pulled into Coverband from Simplecov 12/04/2018
#
# Representation of a source file including it's coverage data, source code,
# source lines and featuring helpers to interpret that data.
###... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/configuration_template.rb | lib/coverband/utils/configuration_template.rb | ####
# This is an example coverband configuration file. In a typical Rails app
# it would be placed in config/coverband.rb
#
# Uncomment or adjust the code to your apps needs
####
# Coverband.configure do |config|
####
# set a redis URL and set it with with some reasonable timeouts
####
# redis_url = ENV["COVERBAND_RED... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/html_formatter.rb | lib/coverband/utils/html_formatter.rb | # frozen_string_literal: true
require "erb"
require "cgi"
require "fileutils"
require "digest/sha1"
require "time"
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov-html
# initial version pulled into Coverband from Simplecov 12/04/2018
####
module Coverband
module Utils
class HTMLF... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/result.rb | lib/coverband/utils/result.rb | # frozen_string_literal: true
require "digest/sha1"
require "forwardable"
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov
# initial version pulled into Coverband from Simplecov 12/04/2018
#
# A code coverage result, initialized from the Hash stdlib built-in coverage
# library generates... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/railtie.rb | lib/coverband/utils/railtie.rb | # frozen_string_literal: true
module Coverband
module RailsEagerLoad
def eager_load!
Coverband.eager_loading_coverage!
super
end
end
Rails::Engine.prepend(RailsEagerLoad) if defined? ::Rails::Engine
class Railtie < Rails::Railtie
initializer "coverband.configure" do |app|
app.mid... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/file_hasher.rb | lib/coverband/utils/file_hasher.rb | # frozen_string_literal: true
module Coverband
module Utils
class FileHasher
@cache = {}
def self.hash_file(file, path_converter: AbsoluteFileConverter.instance)
@cache[file] ||= begin
file = path_converter.convert(file)
Digest::MD5.file(file).hexdigest if File.exist?(fil... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/relative_file_converter.rb | lib/coverband/utils/relative_file_converter.rb | # frozen_string_literal: true
module Coverband
module Utils
class RelativeFileConverter
def self.instance
@instance ||= new(Coverband.configuration.all_root_paths)
end
def self.reset
@instance = nil
end
def self.convert(file)
instance.convert(file)
en... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/dead_methods.rb | lib/coverband/utils/dead_methods.rb | # frozen_string_literal: true
require "coverband/utils/method_definition_scanner"
module Coverband
module Utils
module ArrayToTableInConsole
refine Array do
def to_table
column_sizes =
reduce([]) { |lengths, row|
row.each_with_index.map do |iterand, index|
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/results.rb | lib/coverband/utils/results.rb | # frozen_string_literal: true
####
# A way to access the various coverage data breakdowns
####
module Coverband
module Utils
class Results
attr_accessor :type, :report
def initialize(report)
self.report = report
self.type = Coverband::MERGED_TYPE
@results = {}
end
... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/rails6_ext.rb | lib/coverband/utils/rails6_ext.rb | # frozen_string_literal: true
###
# This backports routing redirect active notification events to Rails 6
#
# * reproducing this event: https://github.com/rails/rails/pull/43755/files
# * and pulls in the later: https://github.com/rails/rails/commit/40dc22f715ede12ab9b7e06d59fae185da2c38c7
# * using alias method alt... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/tasks.rb | lib/coverband/utils/tasks.rb | # frozen_string_literal: true
namespace :coverband do
# handles configuring in require => false and COVERBAND_DISABLE_AUTO_START cases
Coverband.configure unless Coverband.configured?
desc "install coverband configuration file defaults"
task :install do
require "fileutils"
full_path = Gem::Specificati... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/file_list.rb | lib/coverband/utils/file_list.rb | # frozen_string_literal: true
####
# Thanks for all the help SimpleCov https://github.com/colszowka/simplecov
# initial version pulled into Coverband from Simplecov 12/04/2018
#
# An array of SourceFile instances with additional collection helper
# methods for calculating coverage across them etc.
####
module Coverba... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
danmayer/coverband | https://github.com/danmayer/coverband/blob/2ee2e24185629fb8414301522b9dbae38dfc7aaf/lib/coverband/utils/absolute_file_converter.rb | lib/coverband/utils/absolute_file_converter.rb | # frozen_string_literal: true
module Coverband
module Utils
class AbsoluteFileConverter
def initialize(roots)
@cache = {}
@roots = roots.map { |root| "#{File.expand_path(root)}/" }
end
def self.instance
@instance ||= new(Coverband.configuration.all_root_paths)
end... | ruby | MIT | 2ee2e24185629fb8414301522b9dbae38dfc7aaf | 2026-01-04T15:53:56.976483Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.