Sha256: fdab9abb619ab912367adb5ffbaa1ae87ab14e04589d703186758f0c10043840

Contents?: true

Size: 1.15 KB

Versions: 29

Compression:

Stored size: 1.15 KB

Contents

require 'active_record'
require 'active_record/fixtures'

Given /^an? "([^\"]*)" data import fetches results listed in "(.*)"$/ do |model, file_name|
  @data_import_model = model.constantize
  table_name = @data_import_model.table_name

  fixture_path = File.expand_path("features/support/imports/#{file_name}", Dir.pwd) 

  fixture = Fixtures.new @data_import_model.connection, table_name, model, fixture_path

  @data_import_model.connection.transaction(:requires_new => true) do
    fixture.delete_existing_fixtures
    fixture.insert_fixtures
  end
end

When /^a data import verifies "(.*)"$/ do |verification_step_name|
  @verification = @data_import_model.data_miner_config.steps.find { |f|
    f.respond_to?(:description) and f.description == verification_step_name
  }
  @verification_result = begin
                           @verification.run
                           true
                         rescue => e
                           false
                         end
end

Then /^the verification should be successful$/ do
  @verification_result.should be_true
end
Then /^the verification should not be successful$/ do
  @verification_result.should be_false
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
earth-0.11.16 features/step_definitions/data_steps.rb
earth-0.11.15 features/step_definitions/data_steps.rb
earth-0.11.14 features/step_definitions/data_steps.rb
earth-0.11.13 features/step_definitions/data_steps.rb
earth-0.11.12 features/step_definitions/data_steps.rb
earth-0.11.11 features/step_definitions/data_steps.rb
earth-0.11.10 features/step_definitions/data_steps.rb
earth-0.11.9 features/step_definitions/data_steps.rb
earth-0.11.8 features/step_definitions/data_steps.rb
earth-0.11.7 features/step_definitions/data_steps.rb
earth-0.11.6 features/step_definitions/data_steps.rb
earth-0.11.5 features/step_definitions/data_steps.rb
earth-0.11.4 features/step_definitions/data_steps.rb
earth-0.11.3 features/step_definitions/data_steps.rb
earth-0.11.2 features/step_definitions/data_steps.rb
earth-0.11.1 features/step_definitions/data_steps.rb
earth-0.11.0 features/step_definitions/data_steps.rb
earth-0.7.0 features/step_definitions/data_steps.rb
earth-0.6.6 features/step_definitions/data_steps.rb
earth-0.6.5 features/step_definitions/data_steps.rb