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 |
|---|---|---|---|---|---|---|---|---|
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/before_all_spec.rb | spec/integrations/before_all_spec.rb | # frozen_string_literal: true
describe "BeforeAll" do
context "RSpec" do
it "works" do
output = run_rspec("before_all")
expect(output).to include("0 failures")
end
specify "global hooks" do
output = run_rspec("before_all_hooks")
expect(output).to include("0 failures")
end
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/rspec_dissect_spec.rb | spec/integrations/rspec_dissect_spec.rb | # frozen_string_literal: true
describe "RSpecDissect" do
specify "it works", :aggregate_failures do
output = run_rspec("rspec_dissect", env: {"RD_PROF" => "1"})
expect(output).to include("0 failures")
expect(output).to include("RSpecDissect report")
expect(output).to match(/Total time:\s+\d{2}:\d{2... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/tag_prof_spec.rb | spec/integrations/tag_prof_spec.rb | # frozen_string_literal: true
describe "TagProf" do
context "rspec" do
specify "it works", :aggregate_failures do
output = run_rspec("tag_prof", env: {"TAG_PROF" => "type"})
expect(output).to include("TagProf report for type")
expect(output).to match(/type\s+time\s+total\s+%total\s+%time\s+avg... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/factory_all_stub_spec.rb | spec/integrations/factory_all_stub_spec.rb | # frozen_string_literal: true
describe "FactoryAllStub" do
specify "it works" do
output = run_rspec("factory_all_stub")
expect(output).to include("0 failures")
end
end
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/any_fixture_spec.rb | spec/integrations/any_fixture_spec.rb | # frozen_string_literal: true
describe "AnyFixture" do
specify "it works" do
output = run_rspec("any_fixture")
expect(output).to include("0 failures")
end
specify "with usage report enabled" do
output = run_rspec("any_fixture", env: {"ANYFIXTURE_REPORT" => "1"})
expect(output).to include("AnyFi... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/before_all_connection_fixture.rb | spec/integrations/fixtures/minitest/before_all_connection_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_minitest"
require "minitest/autorun"
require "test_prof/recipes/minitest/before_all"
describe "database connection owner" do... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/sample_fixture.rb | spec/integrations/fixtures/minitest/sample_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "minitest/autorun"
require "test_prof/recipes/minitest/sample"
class SomethingTest < Minitest::Test
def test_pass
assert true
end
def test_pass2
assert true
end
end
class CustomTestCase < Minite... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/factory_doctor_fixture.rb | spec/integrations/fixtures/minitest/factory_doctor_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "minitest/autorun"
require "test-prof"
describe "User" do
before do
@user = TestProf::FactoryBot.create(:user)
end
it "generates random names" do
user2... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/event_prof_fixture.rb | spec/integrations/fixtures/minitest/event_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "minitest/autorun"
require "active_support"
require "test-prof"
TestProf::EventProf.configure do |config|
config.per_example = true
end
module Instrumenter
def self.notify(_event, time)
sleep 0.1
Act... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/event_prof_sidekiq_fixture.rb | spec/integrations/fixtures/minitest/event_prof_sidekiq_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "minitest/autorun"
require "sidekiq/testing"
Sidekiq::Testing.inline!
class SingleJob
include Sidekiq::Worker
def perform(*_args)
true
end
end
class BatchJob
include Sideki... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/profilers_fixture.rb | spec/integrations/fixtures/minitest/profilers_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "minitest/autorun"
require "test_prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
class SomethingTest < Minitest::Test
def test_pass
assert true
end
def test_... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/before_all_inherit_fixture.rb | spec/integrations/fixtures/minitest/before_all_inherit_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_minitest"
require "minitest/autorun"
require "test_prof/recipes/minitest/before_all"
class BaseTest < Minitest::Test
prepe... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/before_all_fixture.rb | spec/integrations/fixtures/minitest/before_all_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_minitest"
require "minitest/autorun"
require "test_prof/recipes/minitest/before_all"
describe "User" do
include TestProf::... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/tag_prof_fixture.rb | spec/integrations/fixtures/minitest/tag_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "minitest/autorun"
require "active_support"
require "test-prof"
module Instrumenter
def self.notify(_event, time)
sleep 0.1
ActiveSupport::Notifications.publish(
"test.event",
0,
time
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/event_prof_factory_create_fixture.rb | spec/integrations/fixtures/minitest/event_prof_factory_create_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "minitest/autorun"
require "test-prof"
describe "Post" do
let(:user) { TestProf::FactoryBot.create(:user) }
it "generates random names" do
user2 = TestProf::... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/minitest/memory_prof_fixture.rb | spec/integrations/fixtures/minitest/memory_prof_fixture.rb | # frozen_string_literal: true
require "minitest/autorun"
require "test-prof"
require "securerandom"
describe "First Allocations" do
it "allocates 500 objects" do
500.times.map { SecureRandom.hex }
end
it "allocates 1000 objects" do
1000.times.map { SecureRandom.hex }
end
it "allocates 10_000 objec... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rubocop/aggregate_failures_fixture.rb | spec/integrations/fixtures/rubocop/aggregate_failures_fixture.rb | # frozen_string_literal: true
describe "something" do
context "many examples" do
it { is_expected.to be_ok }
it { expect(subject).to_not be_nil }
end
end
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_connection_fixture.rb | spec/integrations/fixtures/rspec/before_all_connection_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/before_all"
describe "database connection owner" do
context "with before_all" do
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/sample_fixture.rb | spec/integrations/fixtures/rspec/sample_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test_prof/recipes/rspec/sample"
describe "Something" do
it "always passes" do
expect(true).to eq true
end
end
describe "One more thing" do
it "always passes" do
expect(true).to eq true
end
end
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_prof_no_fabrication_fixture.rb | spec/integrations/fixtures/rspec/factory_prof_no_fabrication_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
$LOAD_PATH.delete_if { |p| p =~ /fabrication/ }
require "test-prof"
context "when no fabrication installed" do
it "do nothing" do
expect { Fabricate(:user) }.to raise_error(NameError)
expect(true).to eq true
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/let_it_be_modifiers_fixture.rb | spec/integrations/fixtures/rspec/let_it_be_modifiers_fixture.rb | # frozen_string_literal: true
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/let_it_be"
RSpec.configure do |config|
config.include TestProf::FactoryBot::Syntax::Methods
end
TestProf::LetItBe.configure do |config|
config.de... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_default_let_it_be_fixture.rb | spec/integrations/fixtures/rspec/factory_default_let_it_be_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/let_it_be"
require "test_prof/recipes/rspec/factory_default"
describe "Post" do
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_doctor_fixture.rb | spec/integrations/fixtures/rspec/factory_doctor_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
describe "User" do
let(:user) { TestProf::FactoryBot.create(:user) }
it "generates random names" do
user2 = TestProf::FactoryBot.create(:user)
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_prof_with_variations_fixture.rb | spec/integrations/fixtures/rspec/factory_prof_with_variations_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
describe "User" do
context "created by factory_bot" do
context... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_default_analyze_fixture.rb | spec/integrations/fixtures/rspec/factory_default_analyze_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/factory_default"
describe "Post" do
let(:user) { TestProf::FactoryBot.create(:use... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/tps_prof_fixture.rb | spec/integrations/fixtures/rspec/tps_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "test-prof"
describe "Something" do
it "sleeps a bit" do
sleep 0.12
expect(true).to eq true
end
it "sleeps a bit more" do
sleep 0.43
expect(true).to eq true
end
e... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/rspec_dissect_fixture.rb | spec/integrations/fixtures/rspec/rspec_dissect_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../../lib", __FILE__)
require "test-prof"
class Work
attr_reader :runned
def initialize(val = 0.1)
@value = val
sleep(@value)
end
def run
return false if @runned
sleep @value
@runned = true
end
end
describ... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/any_fixture_fixture.rb | spec/integrations/fixtures/rspec/any_fixture_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/any_fixture"
shared_context "user", user: true do
include TestProf::AnyFixture::D... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/rspec_stamp_fixture_tmpl.rb | spec/integrations/fixtures/rspec/rspec_stamp_fixture_tmpl.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "test-prof"
shared_context "fixxer", fix: :me do
before { @value = true }
end
describe "Something" do
it "fail me" do
expect(@value).to eq true
end
it "fail me with tag", fi... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/rspec_dissect_stamp_fixture_tmpl.rb | spec/integrations/fixtures/rspec/rspec_dissect_stamp_fixture_tmpl.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test-prof"
class Work
attr_reader :runned
def initialize(val = 0.1)
@value = val
sleep(@value)
end
def run
return false if @runned
sleep @value
@runned = true
end
end
describe "... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_prof_no_factory_bot_fixture.rb | spec/integrations/fixtures/rspec/factory_prof_no_factory_bot_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
$LOAD_PATH.delete_if { |p| p =~ /factory_bot/ }
require "test-prof"
context "when no factory_bot installed" do
it "do nothing" do
expect { FactoryBot.create(:user) }.to raise_error(NameError)
expect(true).to ... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/event_prof_fixture.rb | spec/integrations/fixtures/rspec/event_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "test-prof"
TestProf::EventProf.configure do |config|
config.per_example = true
end
module Instrumenter
def self.notify(event = "test.event", time)
sleep 0.1
ActiveSupport::N... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_rails_fixtures_fixture.rb | spec/integrations/fixtures/rspec/before_all_rails_fixtures_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "action_controller/railtie"
require "action_view/railtie"
require "active_record/railtie"
require "rspec/rails"
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_cont... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/event_prof_sidekiq_fixture.rb | spec/integrations/fixtures/rspec/event_prof_sidekiq_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "sidekiq/testing"
Sidekiq::Testing.inline!
class SingleJob
include Sidekiq::Worker
def perform(*_args)
true
end
end
class BatchJob
include Sidekiq::Worker
def perform(co... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/ruby_prof_fixture.rb | spec/integrations/fixtures/rspec/ruby_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
shared_examples_for "Something" do
it "always passes", :rprof do
expect(true).to eq true
end
end
describe... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_default_fixture.rb | spec/integrations/fixtures/rspec/factory_default_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/factory_default"
describe "Post" do
let(:user) { TestProf::FactoryBot.create_defa... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_fixture.rb | spec/integrations/fixtures/rspec/before_all_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/before_all"
shared_context "with user" do
before_all do
@context_user = TestP... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_isolator_fixture.rb | spec/integrations/fixtures/rspec/before_all_isolator_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "sidekiq/testing"
require "isolator"
Isolator.config.raise_exceptions = true
require "test_prof/recipes/r... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/any_fixture_callbacks_fixture.rb | spec/integrations/fixtures/rspec/any_fixture_callbacks_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test_prof/recipes/rspec/any_fixture"
require "test_prof/any_fixture/dsl"
shared_context "user_and_post", user_and_post: true do
include TestProf::AnyFixture::DSL
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/logging_fixture.rb | spec/integrations/fixtures/rspec/logging_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
module Rails
class << self
attr_writer :logger
def logger
@logger ||= Logger.new(IO::NULL)
end
end
end
require "test_prof/recipes/... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/let_it_be_modification_detection_fixture.rb | spec/integrations/fixtures/rspec/let_it_be_modification_detection_fixture.rb | # frozen_string_literal: true
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/let_it_be"
RSpec.configure do |config|
config.define_derived_metadata(let_it_be_frost: true) do |metadata|
metadata[:let_it_be_modifiers] ||= {f... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/stackprof_fixture.rb | spec/integrations/fixtures/rspec/stackprof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
shared_examples_for "Something" do
it "always passes", :sprof do
expect(true).to eq true
end
end
describe... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_hooks_fixture.rb | spec/integrations/fixtures/rspec/before_all_hooks_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/before_all"
module Events
class << self
def events
@events ||= []
e... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/tag_prof_fixture.rb | spec/integrations/fixtures/rspec/tag_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
module Instrumenter
def self.notify(event = "test.event", time)
ActiveSupport::Notifications.publish(
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/let_it_be_fixture.rb | spec/integrations/fixtures/rspec/let_it_be_fixture.rb | # frozen_string_literal: true
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
shared_context "with user" do
let_it_be(:context_user) { create(:user, name: "Lolo") }
end
RSpec.configure do |config|
config.include_context "with user", with_user: true
end
req... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_all_stub_fixture.rb | spec/integrations/fixtures/rspec/factory_all_stub_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/factory_all_stub"
RSpec.configure do |config|
config.include TestProf::FactoryBot... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_prof_fixture.rb | spec/integrations/fixtures/rspec/factory_prof_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
describe "User" do
context "created by factory_bot" do
let(:us... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/before_all_custom_adapter_fixture.rb | spec/integrations/fixtures/rspec/before_all_custom_adapter_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test_prof/recipes/rspec/before_all"
module MyAdapter
class << self
def begin_transaction
ActiveRecord::Base.connection.execute "BEGIN"
end
def r... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_default_fabrication_fixture.rb | spec/integrations/fixtures/rspec/factory_default_fabrication_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/factory_default"
TestProf::FactoryDefault.configure do |config|
config.preserve_a... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/event_prof_factory_create_fixture.rb | spec/integrations/fixtures/rspec/event_prof_factory_create_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
describe "Post" do
let(:user) { TestProf::FactoryBot.create(:user) }
it "generates random names" do
user2 = TestProf::FactoryBot.create(:post).us... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/event_prof_monitor_fixture.rb | spec/integrations/fixtures/rspec/event_prof_monitor_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "test-prof"
TestProf::EventProf.configure do |config|
config.per_example = true
config.rank_by = :count
end
class Work
def one
true
end
def two(flag: false)
flag
end... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/let_it_be_nested_fixture.rb | spec/integrations/fixtures/rspec/let_it_be_nested_fixture.rb | # frozen_string_literal: true
require_relative "../../../support/ar_models"
require_relative "../../../support/transactional_context"
require "test_prof/recipes/rspec/let_it_be"
RSpec.describe "Overriding detection", :transactional do
context "when report_duplicates was set as :raise" do
context "when let_it_b... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/factory_prof_with_nate_fixture.rb | spec/integrations/fixtures/rspec/factory_prof_with_nate_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require_relative "../../../support/ar_models"
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
require "test_prof/factory_prof/nate_heckler"
describe "User" do
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/event_prof_stamp_fixture_tmpl.rb | spec/integrations/fixtures/rspec/event_prof_stamp_fixture_tmpl.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "active_support"
require "test-prof"
module Instrumenter
def self.notify(_event, time)
ActiveSupport::Notifications.publish(
"test.event",
0,
time
)
end
end
describe "Something" do
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/vernier_fixture.rb | spec/integrations/fixtures/rspec/vernier_fixture.rb | # frozen_string_literal: true
$LOAD_PATH.unshift File.expand_path("../../../../../lib", __FILE__)
require "test-prof"
TestProf.configure do |config|
config.output_dir = "../../../../tmp/test_prof"
end
shared_examples_for "Something" do
it "always passes", :vernier do
expect(true).to eq true
end
end
descri... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/integrations/fixtures/rspec/memory_prof_fixture.rb | spec/integrations/fixtures/rspec/memory_prof_fixture.rb | # frozen_string_literal: true
require "test-prof"
require "securerandom"
describe "Examples allocations" do
it "allocates 500 objects" do
500.times.map { SecureRandom.hex }
end
it "allocates 1000 objects" do
1000.times.map { SecureRandom.hex }
end
it "allocates 10_000 objects" do
10_000.times.... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/event_prof_spec.rb | spec/test_prof/event_prof_spec.rb | # frozen_string_literal: true
describe TestProf::EventProf do
# Use fresh config all for every example
after { described_class.remove_instance_variable(:@config) }
before { stub_const("ActiveSupport::Notifications", double(subscribe: nil)) }
subject { described_class.build }
describe ".build" do
befor... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/ruby_prof_spec.rb | spec/test_prof/ruby_prof_spec.rb | # frozen_string_literal: true
describe TestProf::RubyProf do
before do
next if defined?(::RubyProf::WALL_TIME)
stub_const("::RubyProf::WALL_TIME", 0)
end
# Use fresh config all for every example
after { described_class.remove_instance_variable(:@config) }
describe ".config" do
subject { descri... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/rspec_stamp_spec.rb | spec/test_prof/rspec_stamp_spec.rb | # frozen_string_literal: true
require "test_prof/rspec_stamp"
describe TestProf::RSpecStamp do
subject { described_class }
describe "#config" do
after { described_class.remove_instance_variable(:@config) }
subject { described_class.config }
it "handles array tags" do
subject.tags = [:todo]
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/factory_doctor_spec.rb | spec/test_prof/factory_doctor_spec.rb | # frozen_string_literal: true
# Init FactoryDoctor and patch TestProf::FactoryBot
TestProf::FactoryDoctor.init
describe TestProf::FactoryDoctor, :transactional do
before { described_class.start }
after { described_class.stop }
# Ensure meta-queries have been performed
before(:all) { TestProf::FactoryBot.buil... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/factory_default_spec.rb | spec/test_prof/factory_default_spec.rb | # frozen_string_literal: true
# Init FactoryDefault
require "test_prof/factory_default"
TestProf::FactoryDefault.init
TestProf::FactoryDefault.disable!
describe TestProf::FactoryDefault, :transactional do
let(:preserve_traits) { false }
let(:preserve_attributes) { false }
before do
described_class.enable!... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/factory_prof_spec.rb | spec/test_prof/factory_prof_spec.rb | # frozen_string_literal: true
# Init FactoryProf and patch TestProf::FactoryBot, Fabrication
TestProf::FactoryProf.init
TestProf::FactoryProf.configure do |config|
# turn on stacks collection
config.mode = :flamegraph
config.include_variations = false
end
describe TestProf::FactoryProf, :transactional do
befo... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/stack_prof_spec.rb | spec/test_prof/stack_prof_spec.rb | # frozen_string_literal: true
describe TestProf::StackProf do
# Use fresh config all for every example
after { described_class.remove_instance_variable(:@config) }
describe ".config" do
subject { described_class.config }
specify "defaults", :aggregate_failures do
expect(subject.mode).to eq :wall
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/utils_spec.rb | spec/test_prof/utils_spec.rb | # frozen_string_literal: true
require "test_prof"
describe TestProf::Utils do
subject { described_class }
describe ".verify_gem_version" do
let(:gem_version) { Gem::Version.new("1.9.89") }
let(:spec_double) { double("spec", version: gem_version) }
let(:specs) { {"abc" => spec_double} }
before do... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/before_all_spec.rb | spec/test_prof/before_all_spec.rb | # frozen_string_literal: true
require "test_prof/before_all"
RSpec.describe TestProf::BeforeAll do
let(:adapter) { double("Adapter") }
before do
described_class.adapter = adapter
end
describe ".adapter" do
context "when adapter is set" do
it "returns the adapter" do
expect(described_cl... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/memory_prof_spec.rb | spec/test_prof/memory_prof_spec.rb | # frozen_string_literal: true
describe TestProf::MemoryProf do
subject { described_class }
describe ".config" do
let(:config) { subject.config }
it "returns an instance of TestProf::MemoryProf::Configuration" do
expect(config).to be_kind_of(TestProf::MemoryProf::Configuration)
end
describe... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/any_fixture_spec.rb | spec/test_prof/any_fixture_spec.rb | # frozen_string_literal: true
require "test_prof/any_fixture"
describe TestProf::AnyFixture, :transactional, :postgres, sqlite: :file do
subject { described_class }
after { described_class.reset }
describe "#register" do
it "invokes block only once for the same id" do
block = double("block", call: 1... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/memory_prof/printer_spec.rb | spec/test_prof/memory_prof/printer_spec.rb | # frozen_string_literal: true
shared_examples "TestProf::MemoryProf::Printer" do
subject { described_class.new(tracker) }
let(:tracker) do
instance_double(
TestProf::MemoryProf::Tracker,
top_count: 3,
total_memory: 500,
groups: groups,
examples: examples
)
end
let(:group... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/memory_prof/tracker_spec.rb | spec/test_prof/memory_prof/tracker_spec.rb | # frozen_string_literal: true
shared_examples "TestProf::MemoryProf::Tracker" do
let(:list) { TestProf::MemoryProf::Tracker::LinkedList.new(100) }
let(:example) { double("example") }
let(:group) { double("group") }
describe "#start" do
it "initializes a linked list" do
subject.start
expect(su... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/memory_prof/tracker/rss_tool_spec.rb | spec/test_prof/memory_prof/tracker/rss_tool_spec.rb | # frozen_string_literal: true
describe TestProf::MemoryProf::Tracker::RssTool do
subject { described_class }
describe ".tool" do
before do
allow(subject).to receive(:os_type).and_return(os_type)
end
context "when an OS is supported" do
let(:os_type) { :macosx }
it "returns an rss t... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/memory_prof/printer/number_to_human_spec.rb | spec/test_prof/memory_prof/printer/number_to_human_spec.rb | # frozen_string_literal: true
describe TestProf::MemoryProf::Printer::NumberToHuman do
subject { described_class }
describe "#convert" do
let(:convert) { subject.convert(number) }
context "when number is 0" do
let(:number) { 0 }
it "returns 0B" do
expect(convert).to eq("0B")
en... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/utils/sized_ordered_set_spec.rb | spec/test_prof/utils/sized_ordered_set_spec.rb | # frozen_string_literal: true
require "test_prof/utils/sized_ordered_set"
describe TestProf::Utils::SizedOrderedSet do
subject { described_class.new(5) }
context "with implicit comparison" do
it "stores only specified number of elements" do
10.times do
subject << 0
end
expect(subje... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/before_all/adapters/active_record_spec.rb | spec/test_prof/before_all/adapters/active_record_spec.rb | # frozen_string_literal: true
module TestProf
module BeforeAll
def self.configure
end
end
end
require "test_prof/before_all/adapters/active_record"
describe TestProf::BeforeAll::Adapters::ActiveRecord do
context "when using single database", skip: (multi_db? ? "Using multiple databases" : nil) do
l... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/ext/active_record_refind_spec.rb | spec/test_prof/ext/active_record_refind_spec.rb | # frozen_string_literal: true
require "test_prof/ext/active_record_refind"
using TestProf::Ext::ActiveRecordRefind
describe TestProf::Ext::ActiveRecordRefind, :transactional do
describe "#refind" do
it "works" do
user = TestProf::FactoryBot.create(:user)
TestProf::FactoryBot.create(:post, user: use... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/ext/float_duration_spec.rb | spec/test_prof/ext/float_duration_spec.rb | # frozen_string_literal: true
require "test_prof/ext/float_duration"
using TestProf::FloatDuration
describe TestProf::FloatDuration do
it "works" do
expect((27 * 60 + 41.05142).duration).to eq "27:41.051"
end
end
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/ext/string_truncate_spec.rb | spec/test_prof/ext/string_truncate_spec.rb | # frozen_string_literal: true
require "test_prof/ext/string_truncate"
using TestProf::StringTruncate
describe TestProf::StringTruncate do
it "doesn't modify if less than limit", :aggregate_failures do
expect("abc".truncate).to eq "abc"
expect("abcdefgh".truncate(10)).to eq "abcdefgh"
end
it "has defau... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/factory_prof/printers/json_spec.rb | spec/test_prof/factory_prof/printers/json_spec.rb | # frozen_string_literal: true
describe TestProf::FactoryProf::Printers::Json do
let(:stacks) do
stacks = []
stacks << %i[user account]
stacks << %i[user account]
stacks << %i[post account user account]
stacks << %i[comment post]
stacks << %i[comment user account]
stacks << [:user]
sta... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/factory_prof/printers/flamegraph_spec.rb | spec/test_prof/factory_prof/printers/flamegraph_spec.rb | # frozen_string_literal: true
describe TestProf::FactoryProf::Printers::Flamegraph do
subject { described_class }
describe ".convert_stacks" do
it "converts stacks to hierarchy Hash" do
stacks = []
stacks << %i[user account]
stacks << %i[user account]
stacks << %i[post account user acc... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/any_fixture/dump/digest_spec.rb | spec/test_prof/any_fixture/dump/digest_spec.rb | # frozen_string_literal: true
require "test_prof/any_fixture"
describe TestProf::AnyFixture::Dump::Digest do
subject { described_class }
before(:all) do
FileUtils.mkdir_p("tmp/any_fixture_digest")
end
before do
File.write("tmp/any_fixture_digest/1.txt", "Boo!")
end
after(:all) do
FileUtils.... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/event_prof/profiler_spec.rb | spec/test_prof/event_prof/profiler_spec.rb | # frozen_string_literal: true
describe TestProf::EventProf::Profiler do
let(:rank_by) { :time }
let(:top_count) { 5 }
let(:per_example) { false }
let(:options) do
{
rank_by: rank_by,
top_count: top_count,
per_example: per_example
}
end
subject { described_class.new(event: "test.... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/rspec_stamp/parser_spec.rb | spec/test_prof/rspec_stamp/parser_spec.rb | # frozen_string_literal: true
require "test_prof/rspec_stamp/parser"
describe TestProf::RSpecStamp::Parser do
subject { described_class }
describe ".parse" do
it "handles simple expr" do
res = subject.parse('it "works"')
expect(res.fname).to eq "it"
expect(res.desc).to eq "works"
expe... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/cops/rspec/aggregate_examples_spec.rb | spec/test_prof/cops/rspec/aggregate_examples_spec.rb | # frozen_string_literal: true
require "cop_helper"
require "rubocop/test_prof/cops/rspec/aggregate_examples"
RSpec.describe RuboCop::Cop::RSpec::AggregateExamples, :config do
let(:all_cops_config) do
{"DisplayCopNames" => false}
end
subject(:cop) { described_class.new(config) }
let(:cop_config) do
{... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/cops/rspec/aggregate_examples/its_spec.rb | spec/test_prof/cops/rspec/aggregate_examples/its_spec.rb | # frozen_string_literal: true
require "cop_helper"
require "rubocop/test_prof/cops/rspec/aggregate_examples"
RSpec.describe RuboCop::Cop::RSpec::AggregateExamples, ".its", :config do
let(:all_cops_config) do
{"DisplayCopNames" => false}
end
let(:cop_config) do
{"AddAggregateFailuresMetadata" => false}
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/spec/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects_spec.rb | spec/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects_spec.rb | # frozen_string_literal: true
require "cop_helper"
require "rubocop/test_prof/cops/rspec/aggregate_examples"
RSpec.describe RuboCop::Cop::RSpec::AggregateExamples,
".matchers_with_side_effects", :config do
let(:all_cops_config) do
{"DisplayCopNames" => false}
end
subject(:cop) { described_class.new(confi... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/test_prof.rb | lib/test_prof.rb | # frozen_string_literal: true
require "test_prof/version"
require "test_prof/core"
require "test_prof/ruby_prof"
require "test_prof/stack_prof"
require "test_prof/vernier"
require "test_prof/event_prof"
require "test_prof/factory_doctor"
require "test_prof/factory_prof"
require "test_prof/memory_prof"
require "test_p... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/test-prof.rb | lib/test-prof.rb | # frozen_string_literal: true
require "test_prof"
# For RuboCop plugin
if defined?(RuboCop)
module RuboCop
autoload :TestProf, "rubocop/test_prof"
end
end
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/minitest/base_reporter.rb | lib/minitest/base_reporter.rb | # frozen_string_literal: true
require "minitest"
require "test_prof/logging"
module Minitest
module TestProf
class BaseReporter < AbstractReporter # :nodoc:
include ::TestProf::Logging
attr_accessor :io
def initialize(io = $stdout, _options = {})
@io = io
inject_to_minitest_r... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/minitest/event_prof_formatter.rb | lib/minitest/event_prof_formatter.rb | # frozen_string_literal: true
require "test_prof/ext/float_duration"
require "test_prof/ext/string_truncate"
module Minitest
module TestProf
class EventProfFormatter # :nodoc:
using ::TestProf::FloatDuration
using ::TestProf::StringTruncate
def initialize(profilers)
@profilers = profi... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/minitest/test_prof_plugin.rb | lib/minitest/test_prof_plugin.rb | # frozen_string_literal: true
require "test_prof/event_prof/minitest"
require "test_prof/factory_doctor/minitest"
require "test_prof/memory_prof/minitest"
require "test_prof/tag_prof/minitest"
module Minitest # :nodoc:
module TestProf # :nodoc:
def self.configure_options(options = {})
options.tap do |opts... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof.rb | lib/rubocop/test_prof.rb | # frozen_string_literal: true
require "test_prof/utils"
supported = TestProf::Utils.verify_gem_version("rubocop", at_least: "0.51.0")
unless supported
warn "TestProf cops require RuboCop >= 0.51.0 to run."
return
end
require "rubocop/test_prof/plugin"
require "rubocop/test_prof/cops/rspec/aggregate_examples"
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/plugin.rb | lib/rubocop/test_prof/plugin.rb | # frozen_string_literal: true
require "lint_roller"
module RuboCop
module TestProf
# A plugin that integrates TestProf with RuboCop's plugin system.
class Plugin < LintRoller::Plugin
def about
LintRoller::About.new(
name: "test-prof",
version: ::TestProf::VERSION,
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/language.rb | lib/rubocop/test_prof/cops/rspec/language.rb | # frozen_string_literal: true
# This is shamelessly borrowed from RuboCop RSpec
# https://github.com/rubocop-hq/rubocop-rspec/blob/master/lib/rubocop/rspec/language.rb
module RuboCop
module Cop
module RSpec
# RSpec public API methods that are commonly used in cops
module Language
RSPEC = "{(c... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples.rb | # frozen_string_literal: true
require_relative "aggregate_examples/line_range_helpers"
require_relative "aggregate_examples/metadata_helpers"
require_relative "aggregate_examples/node_matchers"
require_relative "aggregate_examples/its"
require_relative "aggregate_examples/matchers_with_side_effects"
module RuboCop
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples/its.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples/its.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
class AggregateExamples < ::RuboCop::Cop::Base
# @example `its`
#
# # Supports regular `its` call with an attribute/method name,
# # or a chain of methods expressed as a string with dots.
#
... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples/node_matchers.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples/node_matchers.rb | # frozen_string_literal: true
require_relative "../language"
module RuboCop
module Cop
module RSpec
class AggregateExamples < ::RuboCop::Cop::Base
# @internal
# Node matchers and searchers.
module NodeMatchers
extend RuboCop::NodePattern::Macros
include RuboCo... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples/matchers_with_side_effects.rb | # frozen_string_literal: true
require_relative "../language"
module RuboCop
module Cop
module RSpec
class AggregateExamples < ::RuboCop::Cop::Base
# When aggregated, the expectations will fail when not supposed to or
# have a risk of not failing when expected to. One example is
# `... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples/metadata_helpers.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples/metadata_helpers.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
class AggregateExamples < ::RuboCop::Cop::Base
# @internal
# Support methods for example metadata.
# Examples with similar metadata are grouped.
#
# Depending on the configuration, `aggregate_... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/rubocop/test_prof/cops/rspec/aggregate_examples/line_range_helpers.rb | lib/rubocop/test_prof/cops/rspec/aggregate_examples/line_range_helpers.rb | # frozen_string_literal: true
module RuboCop
module Cop
module RSpec
class AggregateExamples < ::RuboCop::Cop::Base
# @internal Support methods for keeping newlines around examples.
module LineRangeHelpers
include RangeHelp
private
def range_for_replace(examp... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/test_prof/rubocop.rb | lib/test_prof/rubocop.rb | # frozen_string_literal: true
warn <<~MSG
!!!
Please, update your .rubocop.yml configuration to load TestProf plugin as follows (and fix the error below):
plugins:
- test-prof
!!!
MSG
| ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
test-prof/test-prof | https://github.com/test-prof/test-prof/blob/32513491a2d6b61ef7ef4906731daef61740bb04/lib/test_prof/core.rb | lib/test_prof/core.rb | # frozen_string_literal: true
require "fileutils"
require "logger"
require "test_prof/logging"
require "test_prof/utils"
# Add an alias for Process.clock_gettime "reserved" for TestProf
# (in case some other tool would like to patch it)
module ::Process
class << self
# Already patched by Timecop
if method_... | ruby | MIT | 32513491a2d6b61ef7ef4906731daef61740bb04 | 2026-01-04T15:58:51.674285Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.