Sha256: 65c3840f0beda387016243dd50644e6d1557c960cf60d70679e1e9abc6bfc675

Contents?: true

Size: 574 Bytes

Versions: 3

Compression:

Stored size: 574 Bytes

Contents

require 'spec_helper'

describe Itiel::Load::DatabaseTable do
  before(:each) do
    @output = Itiel::Load::DatabaseTable.new :test, "users"
    @input = [
        {
          "id"   => "1",
          "name" => "Some Name"
        },
        {
          "id"   => "2",
          "name" => "Some Other Name"
        },
    ]
  end

  it "inserts a record for each row" do
    table = double
    allow(@output).to receive(:table).and_return table

    @input.each do |row|
      expect(table).to receive(:insert).and_return row
    end

    @output.persist(@input)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
itiel-0.1.2 spec/loader/database_table_spec.rb
itiel-0.1.1 spec/loader/database_table_spec.rb
itiel-0.1.0 spec/loader/database_table_spec.rb