Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 23 lines (20 sloc) 0.859 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
require 'helpers_for_test'
require 'json'

class TestFromHash < TestCase
  def setup
    @data_dir = File.dirname(__FILE__) + '/data'
    hash_data = JSON.parse(File.read( @data_dir + '/test.jpg.json')).first
    @mini_exiftool = MiniExiftool.from_hash hash_data
  end

  def test_conversion
    assert_kind_of String, @mini_exiftool.model
    assert_kind_of Time, @mini_exiftool['DateTimeOriginal']
    assert_kind_of Float, @mini_exiftool['MaxApertureValue']
    assert_kind_of String, @mini_exiftool.flash
    assert_kind_of Fixnum, @mini_exiftool['ExposureCompensation']
    assert_kind_of String, (@mini_exiftool['SubjectLocation'] || @mini_exiftool['SubjectArea'])
    assert_kind_of Array, @mini_exiftool['Keywords']
    assert_kind_of String, @mini_exiftool['SupplementalCategories']
    assert_kind_of Rational, @mini_exiftool.shutterspeed
  end
end
Something went wrong with that request. Please try again.