[rspec-users] Style issue

James Byrne lists at ruby-forum.com
Thu Apr 23 15:05:40 EDT 2009

In one of my features I have to check to see if a file is created by an
external script and then determine if that file contains specific
information.  So, I ended up with these step definitions:

When /currency exchange rate transfer file should contain rates/ do
  found = false
  fx_code = 'USD'
  File.open(FOREX_XFR_FN).each do |line|
    found = true if
    break if found
  fail(ArgumentError, "Exchange Rate not found for #{fx_code}") if not

When /currency exchange rate transfer file should exist/ do

These work well enough.  What I want to know if this is considered a
normal style for testing this sort of specification and if not then what
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list