Skip to content

Commit 6f4ff80

Browse files
committed
Add PostgreSQL version guard around spec code that requires PostgreSQL 14
1 parent ba28830 commit 6f4ff80

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spec/adapters/postgres_spec.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,12 @@ def c.exec_prepared(*); super; nil end
116116
ds.exclude(4=>[2, 3].map{|i| Float(i)}).wont_be_empty
117117
ds.exclude(2=>[2, 3].map{|i| Float(i)}).must_be_empty
118118

119-
ds.where(2=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).wont_be_empty
120-
ds.where(4=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).must_be_empty
121-
ds.exclude(4=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).wont_be_empty
122-
ds.exclude(2=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).must_be_empty
119+
if @db.server_version >= 140000
120+
ds.where(2=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).wont_be_empty
121+
ds.where(4=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).must_be_empty
122+
ds.exclude(4=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).wont_be_empty
123+
ds.exclude(2=>[2.0, 3.0, 1.0/0.0, -1.0/0.0, 0.0/0.0]).must_be_empty
124+
end
123125

124126
ds.where(Sequel.blob('2')=>%w[2 3].map{|i| Sequel.blob(i)}).wont_be_empty
125127
ds.where(Sequel.blob('4')=>%w[2 3].map{|i| Sequel.blob(i)}).must_be_empty

0 commit comments

Comments
 (0)