Skip to content

Coerce test as cast type in SQL Server is varchar #1298

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions test/cases/coerced_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,20 @@ def test_marshal_dump_and_load_via_disk_coerced
end
end

# Cast type in SQL Server is :varchar rather than Unicode :string.
coerce_tests! :test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
def test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
cache = load_bound_reflection(schema_dump_8_0_path)

assert_no_queries do
columns = cache.columns_hash("courses")
assert_equal 3, columns.size
cast_type = columns["name"].fetch_cast_type(@connection)
assert_not_nil cast_type, "expected cast_type to be present"
assert_equal :varchar, cast_type.type
end
end

private

def with_marshable_time_defaults
Expand Down