From 383d597fa877eba57f5463aba8375b661d9bc041 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 20 May 2024 16:55:11 -0700 Subject: [PATCH] Make pg_interval spec pass on Rails 4.1 This is supposed to check that check_string_typecast_bytesize = false setting works correctly, it doesn't really matter what specific type is returned. --- spec/extensions/pg_interval_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/extensions/pg_interval_spec.rb b/spec/extensions/pg_interval_spec.rb index db0b5e9bfd..63636824e1 100644 --- a/spec/extensions/pg_interval_spec.rb +++ b/spec/extensions/pg_interval_spec.rb @@ -140,7 +140,8 @@ def o.sql_literal(ds) 'v' end proc{@db.typecast_value(:interval, '1'*1000+' secs')}.must_raise(Sequel::InvalidValue) @db.check_string_typecast_bytesize = false - @db.typecast_value(:interval, '1'*1000+' secs').must_be_kind_of ActiveSupport::Duration + secs = '1'*1000 + @db.typecast_value(:interval, secs+' secs').to_i.must_equal secs.to_i end it "should return correct results for Database#schema_type_class" do