Sha256: e4295dab511666118efdb3681bfed9e2a5e1669f1ec9cfbb00a8e1bcecb0a7f5

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

require File.dirname(__FILE__) + '/test_helper'

class BatchTest < Test::Unit::TestCase
  attr_reader :file, :db_yaml, :engine
  def setup
    @file =  File.dirname(__FILE__) + '/all.ebf'
    @db_yaml = File.dirname(__FILE__) + '/database.yml'
    @engine = ETL::Engine.new
  end
  def teardown
    
  end
  def test_etl_batch_file
    #`etl #{file} -c #{db_yaml}`
  end
  def test_batch
    assert_nothing_raised do
      batch = ETL::Batch::Batch.resolve(file, engine)
      batch.execute
    end
  end
  def test_batch_with_file
    assert_nothing_raised do
      batch = ETL::Batch::Batch.resolve(File.new(file), engine)
      batch.execute
    end
  end
  def test_batch_with_batch_object
    assert_nothing_raised do
      batch_instance = ETL::Batch::Batch.new(File.new(file))
      batch_instance.engine = engine
      batch = ETL::Batch::Batch.resolve(batch_instance, engine)
      batch.execute
    end
  end
  def test_batch_with_object_should_fail
    assert_raise(RuntimeError) do
      batch = ETL::Batch::Batch.resolve(0, engine)
    end
  end
end

Version data entries

6 entries across 6 versions & 4 rubygems

Version Path
activewarehouse-etl-1.0.0 test/batch_test.rb
activewarehouse-etl-1.0.0.rc1 test/batch_test.rb
etl-0.9.5.rc1 test/batch_test.rb
activewarehouse-etl-sgonyea-0.9.6 test/batch_test.rb
activewarehouse-etl-0.9.5.rc1 test/batch_test.rb
balinterdi-activewarehouse-etl-0.9.2 test/batch_test.rb