lib/etl/screen/row_count_screen.rb in activewarehouse-etl-0.8.4 vs lib/etl/screen/row_count_screen.rb in activewarehouse-etl-0.9.0

- old
+ new

@@ -2,14 +2,19 @@ module Screen # This screen validates the number of rows which will be bulk loaded # against the results from some sort of a row count query. If there # is a difference then the screen will not pass class RowCountScreen + attr_accessor :control, :configuration def initialize(control, configuration={}) - + @control = control + @configuration = configuration + execute end def execute - + unless Engine.rows_written == configuration[:rows] + raise "Rows written (#{Engine.rows_written}) does not match expected rows (#{configuration[:rows]})" + end end end end end \ No newline at end of file