Skip to content

Instantly share code, notes, and snippets.

@karmajunkie
Created August 11, 2011 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karmajunkie/1139854 to your computer and use it in GitHub Desktop.
Save karmajunkie/1139854 to your computer and use it in GitHub Desktop.
Feature: Parsing a stock file
In order to perform analysis of stock pricing data
As the importer
I want to parse a data file
Scenario: Parsing an AMEX data file
Given a data file containing:
"""
exchange,stock_symbol,date,stock_price_open,stock_price_high,stock_price_low,stock_price_close,stock_volume,stock_price_adj_close
AMEX,KBE,2010-02-08,22.26,22.45,21.90,21.91,5147800,21.91
AMEX,KBE,2010-02-05,22.09,22.37,21.51,22.24,8310700,22.24
AMEX,KBE,2010-02-04,22.72,22.76,21.96,21.98,12615700,21.98
AMEX,KBE,2010-02-03,23.40,23.40,22.87,22.95,6389400,22.95
AMEX,KBE,2010-02-02,23.49,23.62,23.26,23.47,5158500,23.47
AMEX,KBE,2010-02-01,23.22,23.45,23.19,23.42,2814100,23.42
AMEX,KBE,2010-01-29,23.45,23.57,23.06,23.09,3725300,23.09
"""
When I import the data
Then the output should contain "7 records imported"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment