Sha256: a9b1c7896804059cba1ae8606c504175551947abb6e22f9a6d0de4725c1416b5

Contents?: true

Size: 1.1 KB

Versions: 2

Compression:

Stored size: 1.1 KB

Contents

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_base.steps.find { |f|
    f.respond_to?(:description) and f.description == verification_step_name
  }
  @verification_result = begin
                           @verification.run true
                           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

2 entries across 2 versions & 1 rubygems

Version Path
sniff-0.7.2 lib/test_support/cucumber/step_definitions/data_steps.rb
sniff-0.7.1 lib/test_support/cucumber/step_definitions/data_steps.rb