Sha256: 5dc3586eab7a736315fa2d030cc9a2edb704ad325a1f916159a425032af05b6e

Contents?: true

Size: 751 Bytes

Versions: 12

Compression:

Stored size: 751 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

12 entries across 12 versions & 1 rubygems

Version Path
pg_migrate-0.1.14 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.13 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.12 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.7 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.6 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.5 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.4 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.3 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.2 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.1 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.1.0 spec/pg_migrate/sql_reader_spec.rb
pg_migrate-0.0.1 spec/pg_migrate/sql_reader_spec.rb