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
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/json/encoding_test.rb
activesupport/test/json/encoding_test.rb
# frozen_string_literal: true require "securerandom" require_relative "../abstract_unit" require "active_support/core_ext/string/inflections" require "active_support/core_ext/object/with" require "active_support/json" require "active_support/time" require_relative "../time_zone_test_helpers" require_relative "../json/...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/json/encoding_test_cases.rb
activesupport/test/json/encoding_test_cases.rb
# frozen_string_literal: true require "bigdecimal" require "date" require "time" require "pathname" require "uri" module JSONTest class Foo def initialize(a, b) @a, @b = a, b end end class Hashlike def to_hash { foo: "hello", bar: "world" } end end class Custom def initiali...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/autoloading_fixtures/raises_no_method_error.rb
activesupport/test/autoloading_fixtures/raises_no_method_error.rb
# frozen_string_literal: true class RaisesNoMethodError self.foobar_method_doesnt_exist end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/autoloading_fixtures/raises_name_error.rb
activesupport/test/autoloading_fixtures/raises_name_error.rb
# frozen_string_literal: true class RaisesNameError FooBarBaz end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/autoloading_fixtures/raises_load_error.rb
activesupport/test/autoloading_fixtures/raises_load_error.rb
# frozen_string_literal: true # raises a load error typical of the dynamic code that manually raises load errors raise LoadError, "required gem not present kind of error"
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_verifier_metadata_test.rb
activesupport/test/messages/message_verifier_metadata_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require_relative "message_metadata_tests" class MessageVerifierMetadataTest < ActiveSupport::TestCase include MessageMetadataTests test "#verify raises when :purpose does not match" do each_scenario do |data, verifier| assert_equal data,...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_codec_tests.rb
activesupport/test/messages/message_codec_tests.rb
# frozen_string_literal: true require "json" require "active_support/core_ext/object/with" module MessageCodecTests extend ActiveSupport::Concern included do test "::default_serializer determines the default serializer" do ActiveSupport::Messages::Codec.with(default_serializer: Marshal) do asse...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_encryptor_rotator_test.rb
activesupport/test/messages/message_encryptor_rotator_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require_relative "message_rotator_tests" class MessageEncryptorRotatorTest < ActiveSupport::TestCase include MessageRotatorTests test "rotate cipher" do assert_rotate [cipher: "aes-256-gcm"], [cipher: "aes-256-cbc"] end test "rotate verif...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_rotator_tests.rb
activesupport/test/messages/message_rotator_tests.rb
# frozen_string_literal: true require "json" module MessageRotatorTests extend ActiveSupport::Concern included do test "rotate secret" do assert_rotate [secret("new")], [secret("old")], [secret("older")] end test "rotate secret when message has purpose" do assert_rotate [secret("new")], ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/serializer_with_fallback_test.rb
activesupport/test/messages/serializer_with_fallback_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/messages/serializer_with_fallback" class MessagesSerializerWithFallbackTest < ActiveSupport::TestCase test ":marshal serializer dumps objects using Marshal format" do assert_roundtrip serializer(:marshal), Marshal end ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_encryptor_metadata_test.rb
activesupport/test/messages/message_encryptor_metadata_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require_relative "message_metadata_tests" class MessageEncryptorMetadataTest < ActiveSupport::TestCase include MessageMetadataTests private def make_codec(**options) @secret ||= SecureRandom.random_bytes(32) ActiveSupport::MessageE...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/rotation_configuration_test.rb
activesupport/test/messages/rotation_configuration_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/messages/rotation_configuration" class MessagesRotationConfiguration < ActiveSupport::TestCase def setup @config = ActiveSupport::Messages::RotationConfiguration.new end def test_signed_configurations @config.rota...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_verifier_rotator_test.rb
activesupport/test/messages/message_verifier_rotator_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require_relative "message_rotator_tests" class MessageVerifierRotatorTest < ActiveSupport::TestCase include MessageRotatorTests test "rotate digest" do assert_rotate [digest: "SHA256"], [digest: "SHA1"], [digest: "MD5"] end private de...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/messages/message_metadata_tests.rb
activesupport/test/messages/message_metadata_tests.rb
# frozen_string_literal: true require "active_support/json" require "active_support/time" require "active_support/messages/metadata" require "active_support/message_pack" module MessageMetadataTests extend ActiveSupport::Concern included do test "message :purpose must match specified :purpose" do each_...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/event_reporter/log_subscriber_test.rb
activesupport/test/event_reporter/log_subscriber_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/log_subscriber/test_helper" class ActiveSupport::EventReporter::LogSubscriberTest < ActiveSupport::TestCase class MyLogSubscriber < ActiveSupport::EventReporter::LogSubscriber self.namespace = "test" def debug_only(ev...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/class_test.rb
activesupport/test/core_ext/class_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/class" require "active_support/descendants_tracker" class ClassTest < ActiveSupport::TestCase class Parent; end class Foo < Parent; end class Bar < Foo; end class Baz < Bar; end class A < Parent; end class ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/regexp_ext_test.rb
activesupport/test/core_ext/regexp_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/regexp" class RegexpExtAccessTests < ActiveSupport::TestCase def test_multiline assert_equal true, //m.multiline? assert_equal false, //.multiline? assert_equal false, /(?m:)/.multiline? end end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/string_ext_test.rb
activesupport/test/core_ext/string_ext_test.rb
# frozen_string_literal: true require "date" require_relative "../abstract_unit" require "timeout" require_relative "../inflector_test_cases" require_relative "../constantize_test_cases" require "active_support/inflector" require "active_support/core_ext/string" require "active_support/core_ext/object/json" require "...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/kernel_test.rb
activesupport/test/core_ext/kernel_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/kernel" class KernelTest < ActiveSupport::TestCase def test_silence_warnings silence_warnings { assert_nil $VERBOSE } assert_equal 1234, silence_warnings { 1234 } end def test_silence_warnings_verbose_inv...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/load_error_test.rb
activesupport/test/core_ext/load_error_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/load_error" class TestLoadError < ActiveSupport::TestCase def test_with_require assert_raise(LoadError) { require "no_this_file_don't_exist" } end def test_with_load assert_raise(LoadError) { load "nor_do...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/secure_random_test.rb
activesupport/test/core_ext/secure_random_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/securerandom" class SecureRandomTest < ActiveSupport::TestCase def test_base58 s1 = SecureRandom.base58 s2 = SecureRandom.base58 assert_not_equal s1, s2 assert_equal 16, s1.length assert_match(/^[...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/time_ext_test.rb
activesupport/test/core_ext/time_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require_relative "../core_ext/date_and_time_behavior" require_relative "../time_zone_test_helpers" class TimeExtCalculationsTest < ActiveSupport::TestCase def date_time_init(year, month, day, hour, minute, second, usec =...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/range_ext_test.rb
activesupport/test/core_ext/range_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require "active_support/core_ext/numeric" require "active_support/core_ext/range" class RangeTest < ActiveSupport::TestCase def test_to_fs_from_dates date_range = Date.new(2005, 12, 10)..Date.new(2005, 12, 12) as...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/date_and_time_compatibility_test.rb
activesupport/test/core_ext/date_and_time_compatibility_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require_relative "../time_zone_test_helpers" class DateAndTimeCompatibilityTest < ActiveSupport::TestCase include TimeZoneTestHelpers def setup @utc_time = Time.utc(2016, 4, 23, 14, 11, 12) @date_time = DateTi...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/numeric_ext_test.rb
activesupport/test/core_ext/numeric_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require "active_support/core_ext/numeric" require "active_support/core_ext/integer" class NumericExtTimeAndDateTimeTest < ActiveSupport::TestCase def setup @now = Time.local(2005, 2, 10, 15, 30, 45) @dtnow = Date...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/duration_test.rb
activesupport/test/core_ext/duration_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/inflector" require "active_support/time" require "active_support/json" require_relative "../time_zone_test_helpers" require "yaml" class DurationTest < ActiveSupport::TestCase include TimeZoneTestHelpers def test_is_a d...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/name_error_test.rb
activesupport/test/core_ext/name_error_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/name_error" class NameErrorTest < ActiveSupport::TestCase def test_name_error_should_set_missing_name exc = assert_raise NameError do SomeNameThatNobodyWillUse____Really ? 1 : 0 end assert_equal "Nam...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/date_ext_test.rb
activesupport/test/core_ext/date_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require_relative "../core_ext/date_and_time_behavior" require_relative "../time_zone_test_helpers" class DateExtCalculationsTest < ActiveSupport::TestCase def date_time_init(year, month, day, *args) Date.new(year, mo...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/enumerable_test.rb
activesupport/test/core_ext/enumerable_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/array" require "active_support/core_ext/enumerable" Payment = Struct.new(:price) ExpandedPayment = Struct.new(:dollars, :cents) class SummablePayment < Payment def +(p) self.class.new(price + p.price) end end class ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/hash_ext_test.rb
activesupport/test/core_ext/hash_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "bigdecimal" require "yaml" require "active_support/core_ext/hash" require "active_support/core_ext/string/access" require "active_support/core_ext/object/conversions" require "active_support/core_ext/date/conversions" require "active_support/co...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/date_and_time_behavior.rb
activesupport/test/core_ext/date_and_time_behavior.rb
# frozen_string_literal: true require_relative "../abstract_unit" module DateAndTimeBehavior def test_yesterday assert_equal date_time_init(2005, 2, 21, 10, 10, 10), date_time_init(2005, 2, 22, 10, 10, 10).yesterday assert_equal date_time_init(2005, 2, 28, 10, 10, 10), date_time_init(2005, 3, 2, 10, 10, 10)...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/file_test.rb
activesupport/test/core_ext/file_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/file" class AtomicWriteTest < ActiveSupport::TestCase def test_atomic_write_without_errors contents = "Atomic Text" File.atomic_write(file_name, Dir.pwd) do |file| file.write(contents) assert_not F...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/symbol_ext_test.rb
activesupport/test/core_ext/symbol_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/symbol" class SymbolStartsEndsWithTest < ActiveSupport::TestCase def test_starts_ends_with_alias s = :hello assert s.starts_with?("h") assert s.starts_with?("hel") assert_not s.starts_with?("el") a...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/bigdecimal_test.rb
activesupport/test/core_ext/bigdecimal_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/big_decimal" class BigDecimalTest < ActiveSupport::TestCase def test_to_s bd = BigDecimal "0.01" assert_equal "0.01", bd.to_s assert_equal "+0.01", bd.to_s("+F") assert_equal "+0.0 1", bd.to_s("+1F") ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/time_with_zone_test.rb
activesupport/test/core_ext/time_with_zone_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require_relative "../time_zone_test_helpers" require "yaml" class TimeWithZoneTest < ActiveSupport::TestCase include TimeZoneTestHelpers def setup @utc = Time.utc(2000, 1, 1, 0) @time_zone = ActiveSupport::Tim...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/integer_ext_test.rb
activesupport/test/core_ext/integer_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/integer" class IntegerExtTest < ActiveSupport::TestCase PRIME = 22953686867719691230002707821868552601124472329079 def test_multiple_of [ -7, 0, 7, 14 ].each { |i| assert i.multiple_of?(7) } [ -7, 7, 14 ].e...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/date_time_ext_test.rb
activesupport/test/core_ext/date_time_ext_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/time" require_relative "../core_ext/date_and_time_behavior" require_relative "../time_zone_test_helpers" class DateTimeExtCalculationsTest < ActiveSupport::TestCase def date_time_init(year, month, day, hour, minute, second, us...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module_test.rb
activesupport/test/core_ext/module_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/module" Somewhere = Struct.new(:street, :city) do attr_accessor :name def self.country yield end end Someone = Struct.new(:name, :place) do def self.table_name "some_table" end delegate :street, :...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/erb_util_test.rb
activesupport/test/core_ext/erb_util_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/string" module ActiveSupport class ERBUtilTest < ActiveSupport::TestCase def test_template_output source = "Posts: <%= @post.length %>" actual_tokens = tokenize source assert_equal [[:TEXT, "Post...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/pathname/blank_test.rb
activesupport/test/core_ext/pathname/blank_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/pathname/blank" class PathnameBlankTest < ActiveSupport::TestCase def test_blank assert_predicate Pathname.new(""), :blank? assert_not_predicate Pathname.new("test"), :blank? assert_not_predicate Pathna...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/pathname/existence_test.rb
activesupport/test/core_ext/pathname/existence_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/pathname/existence" class PathnameExistenceTest < ActiveSupport::TestCase def test_existence existing = Pathname.new(__FILE__) not_existing = Pathname.new("not existing") assert_equal existing, existing...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/hash/transform_values_test.rb
activesupport/test/core_ext/hash/transform_values_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/hash/indifferent_access" class IndifferentTransformValuesTest < ActiveSupport::TestCase test "indifferent access is still indifferent after mapping values" do original = { a: "a", b: "b" }.with_indifferent_acce...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/kernel/concern_test.rb
activesupport/test/core_ext/kernel/concern_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/kernel/concern" class KernelConcernTest < ActiveSupport::TestCase def test_may_be_defined_at_toplevel mod = ::TOPLEVEL_BINDING.eval "concern(:ToplevelConcern) { }" assert_equal mod, ::ToplevelConcern as...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/deep_dup_test.rb
activesupport/test/core_ext/object/deep_dup_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/deep_dup" class DeepDupTest < ActiveSupport::TestCase def test_array_deep_dup array = [1, [2, 3]] dup = array.deep_dup dup[1][2] = 4 assert_nil array[1][2] assert_equal 4, dup[1][2] end...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/to_param_test.rb
activesupport/test/core_ext/object/to_param_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/to_param" class ToParamTest < ActiveSupport::TestCase class CustomString < String def to_param "custom-#{ self }" end end def test_object foo = Object.new def foo.to_s; "foo" end ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/acts_like_test.rb
activesupport/test/core_ext/object/acts_like_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/date/acts_like" require "active_support/core_ext/string/behavior" require "active_support/core_ext/time/acts_like" require "active_support/core_ext/date_time/acts_like" require "active_support/core_ext/object/acts_lik...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/inclusion_test.rb
activesupport/test/core_ext/object/inclusion_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/inclusion" class InTest < ActiveSupport::TestCase def test_in_array assert 1.in?([1, 2]) assert_not 3.in?([1, 2]) end def test_in_hash h = { "a" => 100, "b" => 200 } assert "a".in?(h) ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/blank_test.rb
activesupport/test/core_ext/object/blank_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/blank" class BlankTest < ActiveSupport::TestCase class EmptyTrue def empty? 0 end end class EmptyFalse def empty? nil end end BLANK = [ EmptyTrue.new, nil, false, "", " ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/instance_variables_test.rb
activesupport/test/core_ext/object/instance_variables_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/instance_variables" class ObjectInstanceVariableTest < ActiveSupport::TestCase def setup @source, @dest = Object.new, Object.new @source.instance_variable_set(:@bar, "bar") @source.instance_varia...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/json_cherry_pick_test.rb
activesupport/test/core_ext/object/json_cherry_pick_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" # These test cases were added to test that cherry-picking the JSON extensions # works correctly, primarily for dependencies problems reported in #16131. They # need to be executed in isolation to reproduce the scenario correctly, because # other tes...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/try_test.rb
activesupport/test/core_ext/object/try_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object" class ObjectTryTest < ActiveSupport::TestCase def setup @string = "Hello" end def test_nonexisting_method method = :undefined_method assert_not_respond_to @string, method assert_nil @st...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/with_test.rb
activesupport/test/core_ext/object/with_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/with" class WithTest < ActiveSupport::TestCase class Record def initialize @public_attr = :public @another_public_attr = :another_public @mixed_attr = :mixed @protected_attr = :pr...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/duplicable_test.rb
activesupport/test/core_ext/object/duplicable_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "bigdecimal" require "active_support/core_ext/object/duplicable" require "active_support/core_ext/numeric/time" class DuplicableTest < ActiveSupport::TestCase OBJECTS = [ method(:puts), method(:puts).unbind, Class.new.include(Singleto...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/to_query_test.rb
activesupport/test/core_ext/object/to_query_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/object/to_query" require "active_support/core_ext/string/output_safety" require "uri" class ToQueryTest < ActiveSupport::TestCase def test_simple_conversion assert_query_equal "a=10", a: 10 end def test_cg...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/object/json_gem_encoding_test.rb
activesupport/test/core_ext/object/json_gem_encoding_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "json" require_relative "../../json/encoding_test_cases" # These test cases were added to test that we do not interfere with JSON gem's # output when the AS encoder is loaded, primarily for problems reported in # #20775. They need to be exec...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/digest/uuid_test.rb
activesupport/test/core_ext/digest/uuid_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/digest" class DigestUUIDExt < ActiveSupport::TestCase def test_constants assert_equal "6ba7b810-9dad-11d1-80b4-00c04fd430c8", "%08x-%04x-%04x-%04x-%04x%08x" % Digest::UUID::DNS_NAMESPACE.unpack("NnnnnN") as...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/wrap_test.rb
activesupport/test/core_ext/array/wrap_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" class WrapTest < ActiveSupport::TestCase class FakeCollection def to_ary ["foo", "bar"] end end class Proxy def initialize(target) @target = target end def method_missing(...) @tar...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/extract_options_test.rb
activesupport/test/core_ext/array/extract_options_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" require "active_support/core_ext/hash" require "active_support/ordered_options" class ExtractOptionsTest < ActiveSupport::TestCase class HashSubclass < Hash end class ExtractableHashSubclass < Hash ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/access_test.rb
activesupport/test/core_ext/array/access_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" class AccessTest < ActiveSupport::TestCase def test_from assert_equal %w( a b c d ), %w( a b c d ).from(0) assert_equal %w( c d ), %w( a b c d ).from(2) assert_equal %w(), %w( a b c d ).from(10) ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/conversions_test.rb
activesupport/test/core_ext/array/conversions_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" require "active_support/core_ext/big_decimal" require "active_support/core_ext/hash" require "active_support/core_ext/string" class ToSentenceTest < ActiveSupport::TestCase def test_plain_array_to_sentence ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/extract_test.rb
activesupport/test/core_ext/array/extract_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" class ExtractTest < ActiveSupport::TestCase def test_extract numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] array_id = numbers.object_id odd_numbers = numbers.extract!(&:odd?) assert_equal [1, 3,...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/array/grouping_test.rb
activesupport/test/core_ext/array/grouping_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/array" class GroupingTest < ActiveSupport::TestCase def test_in_groups_of_with_perfect_fit groups = [] ("a".."i").to_a.in_groups_of(3) do |group| groups << group end assert_equal [%w(a b c), ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/class/attribute_test.rb
activesupport/test/core_ext/class/attribute_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/class/attribute" class ClassAttributeTest < ActiveSupport::TestCase def setup @klass = Class.new do class_attribute :setting class_attribute :timeout, default: 5 class_attribute :system # priv...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/concerning_test.rb
activesupport/test/core_ext/module/concerning_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/concerning" class ModuleConcerningTest < ActiveSupport::TestCase def test_concerning_declares_a_concern_and_includes_it_immediately klass = Class.new { concerning(:Foo) { } } assert_includes klass.an...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/attribute_accessor_test.rb
activesupport/test/core_ext/module/attribute_accessor_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/attribute_accessors" class ModuleAttributeAccessorTest < ActiveSupport::TestCase def setup m = @module = Module.new do mattr_accessor :foo mattr_accessor :bar, instance_writer: false ma...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/attr_internal_test.rb
activesupport/test/core_ext/module/attr_internal_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/attr_internal" class AttrInternalTest < ActiveSupport::TestCase def setup @target = Class.new @instance = @target.new @naming_format_was = Module.attr_internal_naming_format end def teardown...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/remove_method_test.rb
activesupport/test/core_ext/module/remove_method_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/remove_method" module RemoveMethodTests class A def do_something 1 end def do_something_protected 1 end protected :do_something_protected def do_something_private ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/attribute_accessor_per_thread_test.rb
activesupport/test/core_ext/module/attribute_accessor_per_thread_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/attribute_accessors_per_thread" class ModuleAttributeAccessorPerThreadTest < ActiveSupport::TestCase setup do @class = Class.new do thread_mattr_accessor :foo thread_mattr_accessor :bar, ins...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/introspection_test.rb
activesupport/test/core_ext/module/introspection_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/introspection" module ParentA module B module C; end module FrozenC; end FrozenC.freeze end module FrozenB; end FrozenB.freeze end class IntrospectionTest < ActiveSupport::TestCase def ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/anonymous_test.rb
activesupport/test/core_ext/module/anonymous_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/anonymous" class AnonymousTest < ActiveSupport::TestCase test "an anonymous class or module are anonymous" do assert_predicate Module.new, :anonymous? assert_predicate Class.new, :anonymous? end ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/core_ext/module/attribute_aliasing_test.rb
activesupport/test/core_ext/module/attribute_aliasing_test.rb
# frozen_string_literal: true require_relative "../../abstract_unit" require "active_support/core_ext/module/aliasing" module AttributeAliasing class Content attr_accessor :title, :Data def initialize @title, @Data = nil, nil end def title? !title.nil? end def Data? !sel...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/mutual_one.rb
activesupport/test/dependencies/mutual_one.rb
# frozen_string_literal: true $mutual_dependencies_count += 1 require_dependency "mutual_two" require_dependency "mutual_two.rb" require_dependency "mutual_two"
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/conflict.rb
activesupport/test/dependencies/conflict.rb
# frozen_string_literal: true Conflict = 1
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/service_two.rb
activesupport/test/dependencies/service_two.rb
# frozen_string_literal: true class ServiceTwo end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/raises_exception.rb
activesupport/test/dependencies/raises_exception.rb
# frozen_string_literal: true $raises_exception_load_count += 1 raise Exception, "Loading me failed, so do not add to loaded or history." $raises_exception_load_count += 1
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/service_one.rb
activesupport/test/dependencies/service_one.rb
# frozen_string_literal: true $loaded_service_one ||= 0 $loaded_service_one += 1 class ServiceOne end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/cross_site_depender.rb
activesupport/test/dependencies/cross_site_depender.rb
# frozen_string_literal: true class CrossSiteDepender CrossSiteDependency end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/mutual_two.rb
activesupport/test/dependencies/mutual_two.rb
# frozen_string_literal: true $mutual_dependencies_count += 1 require_dependency "mutual_one.rb" require_dependency "mutual_one" require_dependency "mutual_one.rb"
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/check_warnings.rb
activesupport/test/dependencies/check_warnings.rb
# frozen_string_literal: true $check_warnings_load_count += 1 $checked_verbose = $VERBOSE
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/requires_nonexistent1.rb
activesupport/test/dependencies/requires_nonexistent1.rb
# frozen_string_literal: true require_dependency "requires_nonexistent0"
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/requires_nonexistent0.rb
activesupport/test/dependencies/requires_nonexistent0.rb
# frozen_string_literal: true require "RMagickDontExistDude"
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/dependencies/module_folder/lib_class.rb
activesupport/test/dependencies/module_folder/lib_class.rb
# frozen_string_literal: true ConstFromLib = 1 module ModuleFolder class LibClass end end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/deprecation/proxy_wrappers_test.rb
activesupport/test/deprecation/proxy_wrappers_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/deprecation" class ProxyWrappersTest < ActiveSupport::TestCase Waffles = false NewWaffles = :hamburgers module WaffleModule def waffle? true end end def setup @deprecator = ActiveSupport::Depre...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/deprecation/deprecators_test.rb
activesupport/test/deprecation/deprecators_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" class DeprecationTest < ActiveSupport::TestCase setup do @deprecator_names = [:fubar, :foo, :bar] @deprecators = ActiveSupport::Deprecation::Deprecators.new @deprecator_names.each do |name| @deprecators[name] = ActiveSupport::Deprec...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/deprecation/method_wrappers_test.rb
activesupport/test/deprecation/method_wrappers_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/deprecation" class MethodWrappersTest < ActiveSupport::TestCase def setup @klass = Class.new do def new_method; "abc" end alias_method :old_method, :new_method protected def new_protected_method;...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/constant_lookup_test.rb
activesupport/test/testing/constant_lookup_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" class Foo; end class Bar < Foo def index; end def self.index; end end module FooBar; end class ConstantLookupTest < ActiveSupport::TestCase include ActiveSupport::Testing::ConstantLookup def find_foo(name) self.class.determine_constant_fr...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/file_fixtures_test.rb
activesupport/test/testing/file_fixtures_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "pathname" class FileFixturesTest < ActiveSupport::TestCase self.file_fixture_path = File.expand_path("../file_fixtures", __dir__) test "#file_fixture returns Pathname to file fixture" do path = file_fixture("sample.txt") assert_k...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/test_without_assertions_test.rb
activesupport/test/testing/test_without_assertions_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/core_ext/object/with" module TestsWithoutAssertionsTest module Tests def test_without_assertions end end class TestsWithoutAssertionsWarnTest < ActiveSupport::TestCase module AfterTeardown def after_tear...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/method_call_assertions_test.rb
activesupport/test/testing/method_call_assertions_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" class MethodCallAssertionsTest < ActiveSupport::TestCase class Level def increment; 1; end def decrement; end def <<(arg); end end setup do @object = Level.new end def test_assert_called_with_defaults_to_expect_once asse...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/event_reporter_assertions_test.rb
activesupport/test/testing/event_reporter_assertions_test.rb
# frozen_string_literal: true require "active_support/test_case" module ActiveSupport module Testing class EventReporterAssertionsTest < ActiveSupport::TestCase setup do @reporter = ActiveSupport.event_reporter end test "#assert_event_reported" do assert_event_reported("user.c...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/notification_assertions_test.rb
activesupport/test/testing/notification_assertions_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/testing/notification_assertions" module ActiveSupport module Testing class NotificationAssertionsTest < ActiveSupport::TestCase include NotificationAssertions def test_assert_notification assert_notifi...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/after_teardown_assertion_test.rb
activesupport/test/testing/after_teardown_assertion_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" class AfterTeardownAssertionTest < ActiveSupport::TestCase module OtherAfterTeardown def after_teardown super @witness = true end end include AfterTeardownAssertionTest::OtherAfterTeardown attr_writer :witness teardown ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/testing/after_teardown_test.rb
activesupport/test/testing/after_teardown_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" module OtherAfterTeardown def after_teardown super @witness = true end end class AfterTeardownTest < ActiveSupport::TestCase include OtherAfterTeardown attr_writer :witness MyError = Class.new(StandardError) teardown do rai...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/notifications/instrumenter_test.rb
activesupport/test/notifications/instrumenter_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/notifications/instrumenter" module ActiveSupport module Notifications class InstrumenterTest < ActiveSupport::TestCase class TestNotifier attr_reader :starts, :finishes def initialize @star...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/notifications/evented_notification_test.rb
activesupport/test/notifications/evented_notification_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" module ActiveSupport module Notifications class EventedTest < ActiveSupport::TestCase # we expect all exception types to be handled, so test with the most basic type class BadListenerException < Exception; end class Listener ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/xml_mini/xml_mini_engine_test.rb
activesupport/test/xml_mini/xml_mini_engine_test.rb
# frozen_string_literal: true require_relative "../abstract_unit" require "active_support/xml_mini" require "active_support/core_ext/hash/conversions" class XMLMiniEngineTest < ActiveSupport::TestCase def self.run_with_gem(gem_name) require gem_name yield rescue LoadError # Skip tests unless gem is av...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/xml_mini/nokogiri_engine_test.rb
activesupport/test/xml_mini/nokogiri_engine_test.rb
# frozen_string_literal: true require_relative "xml_mini_engine_test" XMLMiniEngineTest.run_with_gem("nokogiri") do class NokogiriEngineTest < XMLMiniEngineTest private def engine "Nokogiri" end def expansion_attack_error Nokogiri::XML::SyntaxError end end end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/xml_mini/nokogirisax_engine_test.rb
activesupport/test/xml_mini/nokogirisax_engine_test.rb
# frozen_string_literal: true require_relative "xml_mini_engine_test" XMLMiniEngineTest.run_with_gem("nokogiri") do class NokogiriSAXEngineTest < XMLMiniEngineTest private def engine "NokogiriSAX" end def expansion_attack_error RuntimeError end end end
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/xml_mini/libxml_engine_test.rb
activesupport/test/xml_mini/libxml_engine_test.rb
# frozen_string_literal: true require_relative "xml_mini_engine_test" XMLMiniEngineTest.run_with_gem("libxml") do class LibxmlEngineTest < XMLMiniEngineTest def setup super LibXML::XML::Error.set_handler(&lambda { |error| }) # silence libxml, exceptions will do end private def engine ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activesupport/test/xml_mini/jdom_engine_test.rb
activesupport/test/xml_mini/jdom_engine_test.rb
# frozen_string_literal: true require_relative "xml_mini_engine_test" XMLMiniEngineTest.run_with_platform("java") do class JDOMEngineTest < XMLMiniEngineTest FILES_DIR = File.expand_path("../fixtures/xml", __dir__) def test_not_allowed_to_expand_entities_to_files attack_xml = <<-EOT <!DOCTYPE m...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false