Skip to content

Commit 01239aa

Browse files
authored
Remove workarounds for old Rubies (#1299)
1 parent 6e287b8 commit 01239aa

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

Diff for: test/cases/coerced_tests.rb

-32
Original file line numberDiff line numberDiff line change
@@ -1948,19 +1948,6 @@ class SchemaCacheTest < ActiveRecord::TestCase
19481948
# Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
19491949
coerce_tests! :test_yaml_dump_and_load, :test_yaml_dump_and_load_with_gzip if RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
19501950

1951-
# Ruby 2.5 and 2.6 have issues to marshal Time before 1900. 2012.sql has one column with default value 1753
1952-
coerce_tests! :test_marshal_dump_and_load_with_gzip, :test_marshal_dump_and_load_via_disk
1953-
1954-
# Tests fail on Windows AppVeyor CI with 'Permission denied' error when renaming file during `File.atomic_write` call.
1955-
unless RbConfig::CONFIG["host_os"] =~ /mswin|mingw/
1956-
def test_marshal_dump_and_load_with_gzip_coerced
1957-
with_marshable_time_defaults { original_test_marshal_dump_and_load_with_gzip }
1958-
end
1959-
def test_marshal_dump_and_load_via_disk_coerced
1960-
with_marshable_time_defaults { original_test_marshal_dump_and_load_via_disk }
1961-
end
1962-
end
1963-
19641951
# Cast type in SQL Server is :varchar rather than Unicode :string.
19651952
coerce_tests! :test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
19661953
def test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
@@ -1977,25 +1964,6 @@ def test_yaml_load_8_0_dump_without_cast_type_still_get_the_right_one
19771964

19781965
private
19791966

1980-
def with_marshable_time_defaults
1981-
# Detect problems
1982-
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("2.7")
1983-
column = @connection.columns(:sst_datatypes).find { |c| c.name == "datetime" }
1984-
current_default = column.default if column.default.is_a?(Time) && column.default.year < 1900
1985-
end
1986-
1987-
# Correct problems
1988-
if current_default.present?
1989-
@connection.change_column_default(:sst_datatypes, :datetime, current_default.dup.change(year: 1900))
1990-
end
1991-
1992-
# Run original test
1993-
yield
1994-
ensure
1995-
# Revert changes
1996-
@connection.change_column_default(:sst_datatypes, :datetime, current_default) if current_default.present?
1997-
end
1998-
19991967
# We need to give the full paths for this to work.
20001968
undef_method :schema_dump_5_1_path
20011969
def schema_dump_5_1_path

0 commit comments

Comments
 (0)