Sha256: 5100c8001f14ada77834e8a1f37f2ebc7030b866f84bc44d5008ba14c773c38f

Contents?: true

Size: 772 Bytes

Versions: 1

Compression:

Stored size: 772 Bytes

Contents

require 'spec_helper'

describe SqlReader do

  before(:all) do
    @sql_reader = SqlReader.new
  end

  it "load single migration" do
    migrations = @sql_reader.load_migration("spec/pg_migrate/input_manifests/single_manifest/up/single1.sql")

    migrations.length.should == 7
    migrations[0] = "select 1"
    migrations[1] = "select 2"
    migrations[2] = "select 3"
    migrations[3] = "create table emp()"
    migrations[4] = "CREATE FUNCTION clean_emp() RETURNS void AS ' DELETE FROM emp; ' LANGUAGE SQL"
    migrations[5] = "CREATE FUNCTION clean_emp2() RETURNS void AS 'DELETE FROM emp;' LANGUAGE SQL"
    migrations[6] = "CREATE FUNCTION populate() RETURNS integer AS $$ DECLARE BEGIN PERFORM select 1; END; $$ LANGUAGE plpgsql"
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pg_migrate-0.1.11 spec/pg_migrate/sql_reader_spec.rb