Sha256: db7be45a8debb6445d9879c48be6d95ba9c3cadbd18f44f0c0c29c8794b9345d
Contents?: true
Size: 974 Bytes
Versions: 9
Compression:
Stored size: 974 Bytes
Contents
require "spec_helper" module Fx module Adapters describe Postgres::Functions, :db do describe ".all" do it "returns `Function` objects" do connection = ActiveRecord::Base.connection connection.execute <<-EOS.strip_heredoc CREATE OR REPLACE FUNCTION test() RETURNS text AS $$ BEGIN RETURN 'test'; END; $$ LANGUAGE plpgsql; EOS functions = Postgres::Functions.new(connection).all first = functions.first expect(functions.size).to eq 1 expect(first.name).to eq "test" expect(first.definition).to eq <<-EOS.strip_heredoc CREATE OR REPLACE FUNCTION public.test() RETURNS text LANGUAGE plpgsql AS $function$ BEGIN RETURN 'test'; END; $function$ EOS end end end end end
Version data entries
9 entries across 9 versions & 2 rubygems