spec/unit/projection_dsl_spec.rb in rom-sql-1.3.1 vs spec/unit/projection_dsl_spec.rb in rom-sql-1.3.2
- old
+ new
@@ -69,9 +69,17 @@
.call { `'event'`.as(:type) }
.map { |attr| attr.sql_literal(ds) }
expect(literals).to eql([%('event' AS "type")])
end
+
+ it 'supports functions without return value' do
+ literals = dsl
+ .call { void::pg_advisory_lock(1).as(:lock) }
+ .map { |attr| attr.sql_literal(ds) }
+
+ expect(literals).to eql([%(PG_ADVISORY_LOCK(1) AS "lock")])
+ end
end
describe '#method_missing' do
it 'responds to methods matching attribute names' do
expect(dsl.id).to eql(schema[:id])