0

I have a CLI app built with Ruby and I want to test that the app is working, my test framework is Aruba with RSpec,it's work is extracting exif data from images. By any chance, who might have an idea on how to test that exif data is extracted from the images?

Linda Kadz
  • 329
  • 2
  • 17

1 Answers1

0

One interesting thing is that "test" is a misnomer because when writing tests all we are doing is listing assertions. You can approach this problem by picking the grain size of your assertions, unit or integration.

For example, integration sized: create a folder in your spec directory called fixtures/sample_files/ and put all the images that you already know the exif result and some files that you want to reject, write assertions verifying a given file match the exif you already know.

For example, unit sized: provide string/bytes contents to the exif reader portion of your app that match the exif you expect, verify it was correct, in this case you don't need sample images or files, all you need is to be able to produce the correct exif header.

Danilo Cabello
  • 2,814
  • 1
  • 23
  • 26