Skip to content

Commit

Permalink
Fix SQLite string_agg spec guards
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Jul 23, 2024
1 parent e7093e1 commit 7772732
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/integration/plugin_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2545,7 +2545,7 @@ def set(k, v, ttl) self[k] = v end
@db.drop_table?(:string_agg_test)
end

cspecify "should have string_agg return aggregated concatenation", :mssql, :derby, [proc{DB.server_version < 90000}, :postgres], [proc{DB.sqlite_version >= 3044000}, :sqlite] do
cspecify "should have string_agg return aggregated concatenation", :mssql, :derby, [proc{DB.server_version < 90000}, :postgres], [proc{DB.sqlite_version < 3044000}, :sqlite] do
h = @ds.select_append(Sequel.string_agg(:s).as(:v)).to_hash(:id, :v)
h[1].must_match(/\A[abc],[abc],[abc],[abc]\z/)
h[2].must_match(/\A(aa|bb),(aa|bb)\z/)
Expand All @@ -2554,7 +2554,7 @@ def set(k, v, ttl) self[k] = v end
@ds.select_append(Sequel.string_agg(:s, '-').order(:o).as(:v)).map([:id, :v]).must_equal [[1, 'a-a-c-b'], [2, 'bb-aa']]
end

cspecify "should have string_agg return aggregated concatenation for distinct values", :mssql, :oracle, :db2, :derby, [proc{DB.server_version < 90000}, :postgres], [proc{DB.sqlite_version >= 3044000}, :sqlite] do
cspecify "should have string_agg return aggregated concatenation for distinct values", :mssql, :oracle, :db2, :derby, [proc{DB.server_version < 90000}, :postgres], [proc{DB.sqlite_version < 3044000}, :sqlite] do
@ds.select_group(:id).select_append(Sequel.string_agg(:s).order(:s).distinct.as(:v)).map([:id, :v]).must_equal [[1, 'a,b,c'], [2, 'aa,bb']]
end
end
Expand Down

0 comments on commit 7772732

Please sign in to comment.