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/activerecord/test/cases/encryption/key_provider_test.rb
activerecord/test/cases/encryption/key_provider_test.rb
# frozen_string_literal: true require "cases/encryption/helper" class ActiveRecord::Encryption::KeyProviderTest < ActiveRecord::EncryptionTestCase setup do @message ||= ActiveRecord::Encryption::Message.new(payload: "some secret") @keys = build_keys(3) @key_provider = ActiveRecord::Encryption::KeyProvid...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/encryption/cipher_test.rb
activerecord/test/cases/encryption/cipher_test.rb
# frozen_string_literal: true require "cases/encryption/helper" class ActiveRecord::Encryption::CipherTest < ActiveRecord::EncryptionTestCase setup do @cipher = ActiveRecord::Encryption::Cipher.new @key = ActiveRecord::Encryption.key_generator.generate_random_key end test "encrypts returns a encrypted ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/encryption/read_only_null_encryptor_test.rb
activerecord/test/cases/encryption/read_only_null_encryptor_test.rb
# frozen_string_literal: true require "cases/encryption/helper" class ActiveRecord::Encryption::ReadOnlyNullEncryptorTest < ActiveRecord::EncryptionTestCase setup do @encryptor = ActiveRecord::Encryption::ReadOnlyNullEncryptor.new end test "decrypt returns the encrypted message" do assert_equal "some t...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/encryption/key_generator_test.rb
activerecord/test/cases/encryption/key_generator_test.rb
# frozen_string_literal: true require "cases/encryption/helper" class ActiveRecord::Encryption::KeyGeneratorTest < ActiveRecord::EncryptionTestCase setup do @generator = ActiveRecord::Encryption::KeyGenerator.new end test "generate_random_key generates random keys with the cipher key length by default" do ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/encryption/cipher/aes256_gcm_test.rb
activerecord/test/cases/encryption/cipher/aes256_gcm_test.rb
# frozen_string_literal: true require "cases/encryption/helper" class ActiveRecord::Encryption::Aes256GcmTest < ActiveRecord::EncryptionTestCase setup do @key = ActiveRecord::Encryption.key_generator.generate_random_key length: ActiveRecord::Encryption::Cipher::Aes256Gcm.key_length @cipher = ActiveRecord::E...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/fixture_set/file_test.rb
activerecord/test/cases/fixture_set/file_test.rb
# frozen_string_literal: true require "cases/helper" require "tempfile" module ActiveRecord class FixtureSet class FileTest < ActiveRecord::TestCase def test_open fh = File.open(::File.join(FIXTURES_ROOT, "accounts.yml")) assert_equal 6, fh.to_a.length end def test_open_with_b...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/type_caster/connection_test.rb
activerecord/test/cases/type_caster/connection_test.rb
# frozen_string_literal: true require "cases/helper" require "models/developer" module ActiveRecord module TypeCaster class ConnectionTest < ActiveSupport::TestCase test "#type_for_attribute is not aware of custom types" do type_caster = Connection.new(AttributedDeveloper, "developers") t...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/delete_manager_test.rb
activerecord/test/cases/arel/delete_manager_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class DeleteManagerTest < Arel::Spec it "handles limit properly" do table = Table.new(:users) dm = Arel::DeleteManager.new dm.take 10 dm.from table dm.key = table[:id] assert_match(/LIMIT 10/, dm.to_sql) ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/attributes_test.rb
activerecord/test/cases/arel/attributes_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class AttributesTest < Arel::Spec it "responds to lower" do relation = Table.new(:users) attribute = relation[:foo] node = attribute.lower assert_equal "LOWER", node.name assert_equal [attribute], node.expres...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/crud_test.rb
activerecord/test/cases/arel/crud_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class FakeCrudder < SelectManager class FakeEngine attr_reader :calls, :connection_pool, :spec, :config def initialize @calls = [] @connection_pool = self @spec = self @config = { adapter: "sqlite3" ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/table_test.rb
activerecord/test/cases/arel/table_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class TableTest < Arel::Spec before do @relation = Table.new(:users) end it "should create join nodes" do join = @relation.create_join "foo", "bar" assert_kind_of Arel::Nodes::InnerJoin, join assert_equal "foo",...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/factory_methods_test.rb
activerecord/test/cases/arel/factory_methods_test.rb
# frozen_string_literal: true require_relative "helper" module Arel module FactoryMethods class TestFactoryMethods < Arel::Test class Factory include Arel::FactoryMethods end def setup @factory = Factory.new end def test_create_join join = @factory.create_...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/helper.rb
activerecord/test/cases/arel/helper.rb
# frozen_string_literal: true require "active_support" require "minitest/autorun" require "arel" require_relative "support/fake_record" Minitest::Expectation.class_eval do def must_be_like(other) self.class.new(target.gsub(/\s+/, " ").strip, ctx).must_equal other.gsub(/\s+/, " ").strip end end module Arel ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/select_manager_test.rb
activerecord/test/cases/arel/select_manager_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class SelectManagerTest < Arel::Spec def test_join_sources manager = Arel::SelectManager.new manager.join_sources << Arel::Nodes::StringJoin.new(Nodes.build_quoted("foo")) assert_equal "SELECT FROM 'foo'", manager.to_sql e...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/insert_manager_test.rb
activerecord/test/cases/arel/insert_manager_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class InsertManagerTest < Arel::Spec describe "insert" do it "can create a ValuesList node" do manager = Arel::InsertManager.new values = manager.create_values_list([%w{ a b }, %w{ c d }]) assert_kind_of Arel::No...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes_test.rb
activerecord/test/cases/arel/nodes_test.rb
# frozen_string_literal: true require_relative "helper" module Arel module Nodes class TestNodes < Arel::Test def test_every_arel_nodes_have_hash_eql_eqeq_from_same_class # #descendants code from activesupport node_descendants = [] ObjectSpace.each_object(Arel::Nodes::Node.singleto...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/update_manager_test.rb
activerecord/test/cases/arel/update_manager_test.rb
# frozen_string_literal: true require_relative "helper" module Arel class UpdateManagerTest < Arel::Spec it "should not quote sql literals" do table = Table.new(:users) um = Arel::UpdateManager.new um.table table um.set [[table[:name], Arel::Nodes::BindParam.new(1)]] _(um.to_sql).m...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/support/fake_record.rb
activerecord/test/cases/arel/support/fake_record.rb
# frozen_string_literal: true require "active_support/core_ext/enumerable" require "date" module FakeRecord class Column < Struct.new(:name, :type) end class Connection attr_reader :tables attr_accessor :visitor def initialize @tables = %w{ users photos developers products} @columns = ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/table_alias_test.rb
activerecord/test/cases/arel/nodes/table_alias_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TableAliasTest < Arel::Spec describe "equality" do it "is equal with equal ivars" do relation1 = Table.new(:users) node1 = TableAlias.new relation1, :foo relation2 = Table.ne...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/sum_test.rb
activerecord/test/cases/arel/nodes/sum_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::SumTest < Arel::Spec describe "as" do it "should alias the sum" do table = Arel::Table.new :users _(table[:id].sum.as("foo").to_sql).must_be_like %{ SUM("users"."id") AS foo } end end describe "equal...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/insert_statement_test.rb
activerecord/test/cases/arel/nodes/insert_statement_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::InsertStatementTest < Arel::Spec describe "#clone" do it "clones columns and values" do statement = Arel::Nodes::InsertStatement.new statement.columns = %w[a b c] statement.values = %w[x y z] dolly = statemen...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/equality_test.rb
activerecord/test/cases/arel/nodes/equality_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class EqualityTest < Arel::Spec # FIXME: backwards compat describe "backwards compat" do describe "to_sql" do it "takes an engine" do engine = FakeRecord::Base.new engine.lea...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/fragments_test.rb
activerecord/test/cases/arel/nodes/fragments_test.rb
# frozen_string_literal: true require_relative "../helper" require "yaml" module Arel module Nodes class FragmentsTest < Arel::Spec describe "equality" do it "is equal with equal values" do array = [Fragments.new(["foo", "bar"]), Fragments.new(["foo", "bar"])] assert_equal 1, a...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/case_test.rb
activerecord/test/cases/arel/nodes/case_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class NodesTest < Arel::Spec describe "Case" do describe "#initialize" do it "sets case expression from first argument" do node = Case.new "foo" assert_equal "foo", node.case ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/ascending_test.rb
activerecord/test/cases/arel/nodes/ascending_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestAscending < Arel::Test def test_construct ascending = Ascending.new "zomg" assert_equal "zomg", ascending.expr end def test_reverse ascending = Ascending.new "zomg" de...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/and_test.rb
activerecord/test/cases/arel/nodes/and_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class AndTest < Arel::Spec describe "equality" do it "is equal with equal ivars" do array = [And.new(["foo", "bar"]), And.new(["foo", "bar"])] assert_equal 1, array.uniq.size end ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/update_statement_test.rb
activerecord/test/cases/arel/nodes/update_statement_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::UpdateStatementTest < Arel::Spec describe "#clone" do it "clones wheres and values" do statement = Arel::Nodes::UpdateStatement.new statement.wheres = %w[a b c] statement.values = %w[x y z] dolly = statement.c...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/casted_test.rb
activerecord/test/cases/arel/nodes/casted_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class CastedTest < Arel::Spec describe "#hash" do it "is equal when eql? returns true" do one = Casted.new 1, 2 also_one = Casted.new 1, 2 assert_equal one.hash, also_one.hash ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/comment_test.rb
activerecord/test/cases/arel/nodes/comment_test.rb
# frozen_string_literal: true require_relative "../helper" require "yaml" module Arel module Nodes class CommentTest < Arel::Spec describe "equality" do it "is equal with equal contents" do array = [Comment.new(["foo"]), Comment.new(["foo"])] assert_equal 1, array.uniq.size ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/not_test.rb
activerecord/test/cases/arel/nodes/not_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class NotTest < Arel::Spec describe "#not" do it "makes a NOT node" do attr = Table.new(:users)[:id] expr = attr.eq(10) node = expr.not _(node).must_be_kind_of Not ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/count_test.rb
activerecord/test/cases/arel/nodes/count_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::CountTest < Arel::Spec describe "as" do it "should alias the count" do table = Arel::Table.new :users _(table[:id].count.as("foo").to_sql).must_be_like %{ COUNT("users"."id") AS foo } end end describ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/window_test.rb
activerecord/test/cases/arel/nodes/window_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class WindowTest < Arel::Spec describe "equality" do it "is equal with equal ivars" do window1 = Window.new window1.orders = [1, 2] window1.partitions = [1] window1.frame 3 ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/delete_statement_test.rb
activerecord/test/cases/arel/nodes/delete_statement_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::DeleteStatementTest < Arel::Spec describe "#clone" do it "clones wheres" do statement = Arel::Nodes::DeleteStatement.new statement.wheres = %w[a b c] dolly = statement.clone _(dolly.wheres).must_equal statemen...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/filter_test.rb
activerecord/test/cases/arel/nodes/filter_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class ::FilterTest < Arel::Spec describe "Filter" do it "should add filter to expression" do table = Arel::Table.new :users _(table[:id].count.filter(table[:income].gteq(40_000)).to_sql).must_be...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/as_test.rb
activerecord/test/cases/arel/nodes/as_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class AsTest < Arel::Spec describe "#as" do it "makes an AS node" do attr = Table.new(:users)[:id] as = attr.as(Arel.sql("foo")) assert_equal attr, as.left assert_equal "foo"...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/infix_operation_test.rb
activerecord/test/cases/arel/nodes/infix_operation_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestInfixOperation < Arel::Test def test_construct operation = InfixOperation.new :+, 1, 2 assert_equal :+, operation.operator assert_equal 1, operation.left assert_equal 2, operation....
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/cte_test.rb
activerecord/test/cases/arel/nodes/cte_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class CteTest < Arel::Spec describe "equality" do it "is equal with equal ivars" do array = [ Cte.new("foo", "bar", materialized: true), Cte.new("foo", "bar", materialized: true) ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/true_test.rb
activerecord/test/cases/arel/nodes/true_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TrueTest < Arel::Spec describe "equality" do it "is equal to other true nodes" do array = [True.new, True.new] assert_equal 1, array.uniq.size end it "is not equal with ot...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/or_test.rb
activerecord/test/cases/arel/nodes/or_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class OrTest < Arel::Spec describe "#or" do it "makes an OR node" do attr = Table.new(:users)[:id] left = attr.eq(10) right = attr.eq(11) node = left.or right _(n...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/bind_param_test.rb
activerecord/test/cases/arel/nodes/bind_param_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class BindParamTest < Arel::Spec it "is equal to other bind params with the same value" do _(BindParam.new(1)).must_equal(BindParam.new(1)) _(BindParam.new("foo")).must_equal(BindParam.new("foo")) end...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/binary_test.rb
activerecord/test/cases/arel/nodes/binary_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class NodesTest < Arel::Spec describe "Binary" do describe "#hash" do it "generates a hash based on its value" do eq = Equality.new("foo", "bar") eq2 = Equality.new("foo", "bar") ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/extract_test.rb
activerecord/test/cases/arel/nodes/extract_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::ExtractTest < Arel::Spec it "should extract field" do table = Arel::Table.new :users _(table[:timestamp].extract("date").to_sql).must_be_like %{ EXTRACT(DATE FROM "users"."timestamp") } end describe "as" do it "...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/homogeneous_in_test.rb
activerecord/test/cases/arel/nodes/homogeneous_in_test.rb
# frozen_string_literal: true require_relative "../helper" require "active_record/type_caster/map" require "active_model" class Arel::Nodes::HomogeneousInTest < Arel::Spec def test_in table = Arel::Table.new :users, type_caster: fake_pg_caster expr = Arel::Nodes::HomogeneousIn.new(["Bobby", "Robert"], table...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/select_core_test.rb
activerecord/test/cases/arel/nodes/select_core_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestSelectCore < Arel::Test def test_clone core = Arel::Nodes::SelectCore.new core.froms = %w[a b c] core.projections = %w[d e f] core.wheres = %w[g h i] dolly = co...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/grouping_test.rb
activerecord/test/cases/arel/nodes/grouping_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class GroupingTest < Arel::Spec it "should create Equality nodes" do grouping = Grouping.new(Nodes.build_quoted("foo")) _(grouping.eq("foo").to_sql).must_be_like "('foo') = 'foo'" end describe ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/descending_test.rb
activerecord/test/cases/arel/nodes/descending_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestDescending < Arel::Test def test_construct descending = Descending.new "zomg" assert_equal "zomg", descending.expr end def test_reverse descending = Descending.new "zomg" ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/node_test.rb
activerecord/test/cases/arel/nodes/node_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel class TestNode < Arel::Test def test_includes_factory_methods assert Arel::Nodes::Node.new.respond_to?(:create_join) end def test_all_nodes_are_nodes Nodes.constants.map { |k| Nodes.const_get(k) }.grep(Clas...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/distinct_test.rb
activerecord/test/cases/arel/nodes/distinct_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class DistinctTest < Arel::Spec describe "equality" do it "is equal to other distinct nodes" do array = [Distinct.new, Distinct.new] assert_equal 1, array.uniq.size end it "is n...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/bin_test.rb
activerecord/test/cases/arel/nodes/bin_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestBin < Arel::Test def test_new assert Arel::Nodes::Bin.new("zomg") end def test_default_to_sql viz = Arel::Visitors::ToSql.new Table.engine.connection_pool node = Arel::Nodes:...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/bound_sql_literal_test.rb
activerecord/test/cases/arel/nodes/bound_sql_literal_test.rb
# frozen_string_literal: true require_relative "../helper" require "yaml" module Arel module Nodes class BoundSqlLiteralTest < Arel::Spec describe "equality" do it "is equal with equal components" do node1 = BoundSqlLiteral.new("foo + ?", [2], {}) node2 = BoundSqlLiteral.new("f...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/named_function_test.rb
activerecord/test/cases/arel/nodes/named_function_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestNamedFunction < Arel::Test def test_construct function = NamedFunction.new "omg", "zomg" assert_equal "omg", function.name assert_equal "zomg", function.expressions end def te...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/false_test.rb
activerecord/test/cases/arel/nodes/false_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class FalseTest < Arel::Spec describe "equality" do it "is equal to other false nodes" do array = [False.new, False.new] assert_equal 1, array.uniq.size end it "is not equal wit...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/sql_literal_test.rb
activerecord/test/cases/arel/nodes/sql_literal_test.rb
# frozen_string_literal: true require_relative "../helper" require "yaml" module Arel module Nodes class SqlLiteralTest < Arel::Spec before do @visitor = Visitors::ToSql.new Table.engine.lease_connection end def compile(node) @visitor.accept(node, Collectors::SQLString.new).va...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/over_test.rb
activerecord/test/cases/arel/nodes/over_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::OverTest < Arel::Spec describe "as" do it "should alias the expression" do table = Arel::Table.new :users _(table[:id].count.over.as("foo").to_sql).must_be_like %{ COUNT("users"."id") OVER () AS foo } end...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/select_statement_test.rb
activerecord/test/cases/arel/nodes/select_statement_test.rb
# frozen_string_literal: true require_relative "../helper" class Arel::Nodes::SelectStatementTest < Arel::Spec describe "#clone" do it "clones cores" do statement = Arel::Nodes::SelectStatement.new %w[a b c] dolly = statement.clone _(dolly.cores).must_equal statement.cores _(dolly....
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/nodes/unary_operation_test.rb
activerecord/test/cases/arel/nodes/unary_operation_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Nodes class TestUnaryOperation < Arel::Test def test_construct operation = UnaryOperation.new :-, 1 assert_equal :-, operation.operator assert_equal 1, operation.expr end def test_operation_a...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/attributes/attribute_test.rb
activerecord/test/cases/arel/attributes/attribute_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Attributes class AttributeTest < Arel::Spec describe "#not_eq" do it "should create a NotEqual node" do relation = Table.new(:users) _(relation[:id].not_eq(10)).must_be_kind_of Nodes::NotEqual ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/attributes/math_test.rb
activerecord/test/cases/arel/attributes/math_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Attributes class MathTest < Arel::Spec %i[* /].each do |math_operator| it "average should be compatible with #{math_operator}" do table = Arel::Table.new :users _(table[:id].average.public_send(math_o...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/postgres_test.rb
activerecord/test/cases/arel/visitors/postgres_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Visitors class PostgresTest < Arel::Spec before do @visitor = PostgreSQL.new Table.engine.lease_connection @table = Table.new(:users) @attr = @table[:id] end def compile(node) @visito...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/to_sql_test.rb
activerecord/test/cases/arel/visitors/to_sql_test.rb
# frozen_string_literal: true require_relative "../helper" require "bigdecimal" module Arel module Visitors class ToSQLTest < Arel::Spec describe "the to_sql visitor" do before do @conn = FakeRecord::Base.new @visitor = ToSql.new @conn.lease_connection @table = Table....
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
true
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/dot_test.rb
activerecord/test/cases/arel/visitors/dot_test.rb
# frozen_string_literal: true require_relative "../helper" require "active_model/attribute" module Arel module Visitors class TestDot < Arel::Test def setup @visitor = Visitors::Dot.new end def assert_edge(edge_name, dot_string) assert_match(/->.*label="#{edge_name}"/, dot_str...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/dispatch_contamination_test.rb
activerecord/test/cases/arel/visitors/dispatch_contamination_test.rb
# frozen_string_literal: true require_relative "../helper" require "concurrent" module Arel module Visitors class DummyVisitor < Visitor def initialize super @barrier = Concurrent::CyclicBarrier.new(2) end def visit_Arel_Visitors_DummySuperNode(node) 42 end ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/sqlite_test.rb
activerecord/test/cases/arel/visitors/sqlite_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Visitors class SqliteTest < Arel::Spec before do @visitor = SQLite.new Table.engine.lease_connection end def compile(node) @visitor.accept(node, Collectors::SQLString.new).value end it "...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/visitors/mysql_test.rb
activerecord/test/cases/arel/visitors/mysql_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Visitors class MysqlTest < Arel::Spec before do @visitor = MySQL.new Table.engine.lease_connection end def compile(node) @visitor.accept(node, Collectors::SQLString.new).value end ### ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/collectors/composite_test.rb
activerecord/test/cases/arel/collectors/composite_test.rb
# frozen_string_literal: true require_relative "../helper" require "arel/collectors/bind" require "arel/collectors/composite" module Arel module Collectors class TestComposite < Arel::Test def setup @conn = FakeRecord::Base.new @visitor = Visitors::ToSql.new @conn.lease_connection ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/collectors/sql_string_test.rb
activerecord/test/cases/arel/collectors/sql_string_test.rb
# frozen_string_literal: true require_relative "../helper" module Arel module Collectors class TestSqlString < Arel::Test def setup @conn = FakeRecord::Base.new @visitor = Visitors::ToSql.new @conn.lease_connection super end def collect(node) @visitor.accept(no...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/collectors/substitute_bind_collector_test.rb
activerecord/test/cases/arel/collectors/substitute_bind_collector_test.rb
# frozen_string_literal: true require_relative "../helper" require "arel/collectors/substitute_binds" require "arel/collectors/sql_string" module Arel module Collectors class TestSubstituteBindCollector < Arel::Test def setup @conn = FakeRecord::Base.new @visitor = Visitors::ToSql.new @con...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/arel/collectors/bind_test.rb
activerecord/test/cases/arel/collectors/bind_test.rb
# frozen_string_literal: true require_relative "../helper" require "arel/collectors/bind" module Arel module Collectors class TestBind < Arel::Test def setup @conn = FakeRecord::Base.new @visitor = Visitors::ToSql.new @conn.lease_connection super end def collect(node) ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/assertions/query_assertions_test.rb
activerecord/test/cases/assertions/query_assertions_test.rb
# frozen_string_literal: true require "cases/helper" require "models/post" require "active_record/testing/query_assertions" module ActiveRecord module Assertions class QueryAssertionsTest < ActiveSupport::TestCase extend AdapterHelper include QueryAssertions def test_assert_queries_count ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/coders/yaml_column_test.rb
activerecord/test/cases/coders/yaml_column_test.rb
# frozen_string_literal: true require "cases/helper" module ActiveRecord module Coders class YAMLColumnTest < ActiveRecord::TestCase setup do @use_yaml_unsafe_load = ActiveRecord.use_yaml_unsafe_load ActiveRecord.use_yaml_unsafe_load = true end teardown do ActiveRecord...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/coders/json_test.rb
activerecord/test/cases/coders/json_test.rb
# frozen_string_literal: true require "cases/helper" module ActiveRecord module Coders class JSONTest < ActiveRecord::TestCase def test_returns_nil_if_empty_string_given coder = JSON.new assert_nil coder.load("") end def test_returns_nil_if_nil_given coder = JSON.new ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/scoping/default_scoping_test.rb
activerecord/test/cases/scoping/default_scoping_test.rb
# frozen_string_literal: true require "cases/helper" require "models/post" require "models/comment" require "models/developer" require "models/project" require "models/computer" require "models/cat" require "models/mentor" require "concurrent/atomic/cyclic_barrier" class DefaultScopingTest < ActiveRecord::TestCase ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/scoping/relation_scoping_test.rb
activerecord/test/cases/scoping/relation_scoping_test.rb
# frozen_string_literal: true require "cases/helper" require "models/post" require "models/author" require "models/developer" require "models/computer" require "models/project" require "models/comment" require "models/category" require "models/person" require "models/reference" class RelationScopingTest < ActiveRecor...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/scoping/named_scoping_test.rb
activerecord/test/cases/scoping/named_scoping_test.rb
# frozen_string_literal: true require "cases/helper" require "models/post" require "models/topic" require "models/comment" require "models/reply" require "models/author" require "models/developer" require "models/computer" class NamedScopingTest < ActiveRecord::TestCase fixtures :posts, :authors, :topics, :comments...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/persistence/reload_association_cache_test.rb
activerecord/test/cases/persistence/reload_association_cache_test.rb
# frozen_string_literal: true require "cases/helper" require "models/publication" require "models/editorship" require "models/editor" class ReloadAssociationCacheTest < ActiveRecord::TestCase def test_reload_sets_correct_owner_for_association_cache publication = Publication.create!(name: "Rails Way") assert...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/attribute_methods/read_test.rb
activerecord/test/cases/attribute_methods/read_test.rb
# frozen_string_literal: true require "cases/helper" require "active_support/core_ext/enumerable" module ActiveRecord module AttributeMethods class ReadTest < ActiveRecord::TestCase FakeColumn = Struct.new(:name) do def type; :integer; end end def setup @klass = Class.new(Clas...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/attribute_methods/time_zone_converter_test.rb
activerecord/test/cases/attribute_methods/time_zone_converter_test.rb
# frozen_string_literal: true require "cases/helper" require "active_support/core_ext/enumerable" require "models/topic" module ActiveRecord module AttributeMethods module TimeZoneConversion class TimeZoneConverterTest < ActiveRecord::TestCase def test_comparison_with_date_time_type subt...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/numericality_validation_test.rb
activerecord/test/cases/validations/numericality_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/numeric_data" class NumericalityValidationTest < ActiveRecord::TestCase def setup @model_class = NumericData.dup end attr_reader :model_class def test_column_with_precision model_class.validates_numericality_of( :unscaled_ban...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/absence_validation_test.rb
activerecord/test/cases/validations/absence_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/face" require "models/interest" require "models/human" require "models/topic" class AbsenceValidationTest < ActiveRecord::TestCase def test_non_association boy_klass = Class.new(Human) do def self.name; "Boy" end validates_absence_...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/i18n_validation_test.rb
activerecord/test/cases/validations/i18n_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" require "models/reply" class I18nValidationTest < ActiveRecord::TestCase repair_validations(Topic, Reply) def setup repair_validations(Topic, Reply) Reply.validates_presence_of(:title) @topic = Topic.new @old_load_path, @...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/association_validation_test.rb
activerecord/test/cases/validations/association_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" require "models/reply" require "models/human" require "models/interest" class AssociationValidationTest < ActiveRecord::TestCase fixtures :topics repair_validations(Topic, Reply) def test_validates_associated_many Topic.validates_...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/uniqueness_validation_test.rb
activerecord/test/cases/validations/uniqueness_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" require "models/reply" require "models/warehouse_thing" require "models/guid" require "models/event" require "models/dashboard" require "models/uuid_item" require "models/author" require "models/person" require "models/essay" require "models/k...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/i18n_generate_message_validation_test.rb
activerecord/test/cases/validations/i18n_generate_message_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" class I18nGenerateMessageValidationTest < ActiveRecord::TestCase class Backend < I18n::Backend::Simple include I18n::Backend::Fallbacks end def setup Topic.clear_validators! @topic = Topic.new I18n.backend = Backend.new...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/length_validation_test.rb
activerecord/test/cases/validations/length_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/owner" require "models/pet" require "models/person" class LengthValidationTest < ActiveRecord::TestCase fixtures :owners setup do @owner = Class.new(Owner) do def self.name; "Owner"; end end end def test_validates_size_of_ass...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/validations/presence_validation_test.rb
activerecord/test/cases/validations/presence_validation_test.rb
# frozen_string_literal: true require "cases/helper" require "models/human" require "models/face" require "models/interest" require "models/speedometer" require "models/dashboard" class PresenceValidationTest < ActiveRecord::TestCase class Boy < Human; end repair_validations(Boy) def test_validates_presence_o...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/unsigned_type_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/unsigned_type_test.rb
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" class UnsignedTypeTest < ActiveRecord::AbstractMysqlTestCase include SchemaDumpingHelper self.use_transactional_tests = false class UnsignedType < ActiveRecord::Base end setup do @connection = ActiveRecord::Ba...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/sp_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/sp_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" require "models/reply" class StoredProcedureTest < ActiveRecord::AbstractMysqlTestCase fixtures :topics def setup @connection = ActiveRecord::Base.lease_connection unless ActiveRecord::Base.lease_connection.database_version >= "5...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/mysql_boolean_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/mysql_boolean_test.rb
# frozen_string_literal: true require "cases/helper" class MySQLBooleanTest < ActiveRecord::AbstractMysqlTestCase self.use_transactional_tests = false class BooleanType < ActiveRecord::Base self.table_name = "mysql_booleans" end setup do @connection = ActiveRecord::Base.lease_connection @connect...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/bind_parameter_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/bind_parameter_test.rb
# frozen_string_literal: true require "cases/helper" require "models/topic" require "models/post" module ActiveRecord module ConnectionAdapters class AbstractMysqlAdapter class BindParameterTest < ActiveRecord::AbstractMysqlTestCase fixtures :topics, :posts def test_update_question_marks ...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/empty_all_tables_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/empty_all_tables_test.rb
# frozen_string_literal: true require "cases/helper" require "support/connection_helper" require "models/author" require "models/bulb" require "models/car" class MySQLEmptyTablesTest < ActiveRecord::AbstractMysqlTestCase self.use_transactional_tests = false def setup @conn = ActiveRecord::Base.lease_connecti...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/sql_types_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/sql_types_test.rb
# frozen_string_literal: true require "cases/helper" class SqlTypesTest < ActiveRecord::AbstractMysqlTestCase def test_binary_types assert_equal "varbinary(64)", type_to_sql(:binary, 64) assert_equal "varbinary(4095)", type_to_sql(:binary, 4095) assert_equal "blob", type_to_sql(:binary, 4096) assert...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/optimizer_hints_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/optimizer_hints_test.rb
# frozen_string_literal: true require "cases/helper" require "models/post" class OptimizerHintsTest < ActiveRecord::AbstractMysqlTestCase if supports_optimizer_hints? fixtures :posts def test_optimizer_hints assert_queries_match(%r{\ASELECT /\*\+ NO_RANGE_OPTIMIZATION\(posts index_posts_on_author_id\...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/virtual_column_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/virtual_column_test.rb
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" if ActiveRecord::Base.lease_connection.supports_virtual_columns? class VirtualColumnTest < ActiveRecord::AbstractMysqlTestCase include SchemaDumpingHelper self.use_transactional_tests = false class VirtualColu...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/auto_increment_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/auto_increment_test.rb
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" class AutoIncrementTest < ActiveRecord::AbstractMysqlTestCase include SchemaDumpingHelper def setup @connection = ActiveRecord::Base.lease_connection end def teardown @connection.drop_table :auto_increments,...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/case_sensitivity_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/case_sensitivity_test.rb
# frozen_string_literal: true require "cases/helper" class CaseSensitivityTest < ActiveRecord::AbstractMysqlTestCase class CollationTest < ActiveRecord::Base end repair_validations(CollationTest) def test_columns_include_collation_different_from_table assert_equal "utf8mb4_bin", CollationTest.columns_ha...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/table_options_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/table_options_test.rb
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" class TableOptionsTest < ActiveRecord::AbstractMysqlTestCase include SchemaDumpingHelper def setup @connection = ActiveRecord::Base.lease_connection end def teardown @connection.drop_table "mysql_table_optio...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/charset_collation_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/charset_collation_test.rb
# frozen_string_literal: true require "cases/helper" require "support/schema_dumping_helper" class CharsetCollationTest < ActiveRecord::AbstractMysqlTestCase include SchemaDumpingHelper setup do @connection = ActiveRecord::Base.lease_connection @connection.create_table :charset_collations, id: { type: :s...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/json_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/json_test.rb
# frozen_string_literal: true require "cases/helper" require "cases/json_shared_test_cases" if ActiveRecord::Base.lease_connection.supports_json? class JSONTest < ActiveRecord::AbstractMysqlTestCase include JSONSharedTestCases self.use_transactional_tests = false def setup super @connection...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/transaction_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/transaction_test.rb
# frozen_string_literal: true require "cases/helper" require "support/connection_helper" module ActiveRecord class TransactionTest < ActiveRecord::AbstractMysqlTestCase self.use_transactional_tests = false class Sample < ActiveRecord::Base self.table_name = "samples" end setup do @abor...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false
rails/rails
https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/activerecord/test/cases/adapters/abstract_mysql_adapter/quoting_test.rb
activerecord/test/cases/adapters/abstract_mysql_adapter/quoting_test.rb
# frozen_string_literal: true require "cases/helper" class QuotingTest < ActiveRecord::AbstractMysqlTestCase def setup super @conn = ActiveRecord::Base.lease_connection end def test_cast_bound_integer assert_equal "42", @conn.cast_bound_value(42) end def test_cast_bound_big_decimal assert_...
ruby
MIT
ba0d6f09e991d0621cc30f19c9d189cd21dbf76e
2026-01-04T15:37:27.222351Z
false