Sha256: 1eb697415959607b82c4d1c3ee1b1c2d218b7d426bd43caead35cd2c33d95320

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 KB

Contents

Feature: Join multiple files into one output file

  Scenario: Successful transformation
    Given a "products1.csv" data file containing:
    """
    id,name,category
    PROD-1,product name 1,Main category > Subcategory > Sub-subcategory
    PROD-2,product name 2,Main category > Subcategory > Sub-subcategory
    """
    And a "products2.csv" data file containing:
    """
    id,name,category
    PROD-3,product name 3,Main category > Subcategory > Sub-subcategory
    PROD-4,product name 4,Main category > Subcategory > Sub-subcategory
    """
    And the following definition:
    """
    source :products do
      file "products*.csv"
      field :id, String
      field :name, String
      field :category, String
    end

    source :transformed_products do
      field :item, String
      field :title, String
      field :category, String
    end

    transform :products => :transformed_products do |record|
      record[:item] = record[:id]
      record[:title] = record[:name]
      output record
    end
    """
    When I execute the definition
    Then the process should exit successfully
    And there should be a "transformed_products.csv" data file in the upload directory containing:
    """
    item,title,category
    PROD-1,product name 1,Main category > Subcategory > Sub-subcategory
    PROD-2,product name 2,Main category > Subcategory > Sub-subcategory
    PROD-3,product name 3,Main category > Subcategory > Sub-subcategory
    PROD-4,product name 4,Main category > Subcategory > Sub-subcategory
    """

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cranium-0.8.1 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.8 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.7 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.6.1 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.5 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.4.3 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.4.2 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.4.1 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.4 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.3.1 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.3.0 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.2.1 features/transform/join_multiple_files_into_one_output_file.feature
cranium-0.2.0 features/transform/join_multiple_files_into_one_output_file.feature