Read Canned Data File For Unit Test

/ Published in: Ruby
Save to your folder(s)

Copy this code and paste it in your HTML
  1. class Test::Unit::TestCase
  2. def canned_file(filename, format = :xml)
  3. File::read("test/data/#{filename}.#{format}")
  4. end
  5. end

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.