I have a requirement to fetch a data feed from our central bank and set
a variety of currency exchange rates from that feed. My question is how
does one approach behavioural driven design with autonomous automated
processing? What I started with is this:
Feature: Automatically Retrieve and Store Foreign Currency Exchange
In order to accurately set foreign currency exchange rates daily
The automated system
Should automatically retrieve and store central bank exchange rates
To Reduce Costs and Protect Revenue
Scenario: Retrieve Exchange Rates from the Bank of Canada RSS feed
Given an RSS feed
When I access the RSS feed
Then I should see “Bank of Canada: Noon Foreign Exchange Rates”
And I should see today’s date in “yyyy-mm-dd” format
Now, while I have a pretty good idea how I am going to accomplish this,
via cron and a standalone Ruby script, I am sort of perplexed about how
I should construct the feature step definitions and how I would test
this. I figure I just have to take as given that cron works because
that is not my code. But how best to test that the rest works?
The automatic script will contain not much more than a list of the
external libraries a call to a methods in class that I have named
ForexCASource, loop through and map the returned array of hashes to the
corresponding CurrencyExchangeRate attributes of a new row, call #save!
and repeat until finished.
How have others handled this sort of thing?