Sha256: 982a6f3d4c1bcdadac4f06fd1da4cd49e68bb3e801f7e04865c898b9b5c8bc52

Contents?: true

Size: 706 Bytes

Versions: 14

Compression:

Stored size: 706 Bytes

Contents

shared_examples_for "a baza importer driver" do
  let(:driver) { constant.new(debug: false) }
  let(:db) { driver.db }
  let(:test_table) do
    db.tables.create(
      "test",
      columns: [
        {name: "id", type: :int, autoincr: true, primarykey: true},
        {name: "text", type: :varchar}
      ]
    )
    db.tables[:test]
  end

  before do
    driver.before
  end

  after do
    driver.after
  end

  it "imports sql" do
    test_table

    io = StringIO.new
    dumper = Baza::Dump.new(db: db)
    dumper.dump(io)
    io.rewind

    test_table.drop

    importer = Baza::Commands::Importer.new(db: db, io: io)
    importer.execute

    expect(db.tables[:test].name).to eq "test"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
baza-0.0.38 spec/support/driver_importer_collection.rb
baza-0.0.37 spec/support/driver_importer_collection.rb
baza-0.0.36 spec/support/driver_importer_collection.rb
baza-0.0.35 spec/support/driver_importer_collection.rb
baza-0.0.34 spec/support/driver_importer_collection.rb
baza-0.0.33 spec/support/driver_importer_collection.rb
baza-0.0.32 spec/support/driver_importer_collection.rb
baza-0.0.31 spec/support/driver_importer_collection.rb
baza-0.0.30 spec/support/driver_importer_collection.rb
baza-0.0.29 spec/support/driver_importer_collection.rb
baza-0.0.28 spec/support/driver_importer_collection.rb
baza-0.0.27 spec/support/driver_importer_collection.rb
baza-0.0.26 spec/support/driver_importer_collection.rb
baza-0.0.25 spec/support/driver_importer_collection.rb