Skip to content
This repository
Browse code

Adapting tests for newer versions of exiftool.

  • Loading branch information...
commit 9b0547a523cb12db6e6a17c012c13b90a96f48d1 1 parent da1169e
janfri authored December 31, 2010
8  test/test_class_methods.rb
@@ -27,14 +27,6 @@ def test_new
27 27
     rescue MiniExiftool::Error => e
28 28
       assert_match /File 'not_existing_file' does not exist/, e.message
29 29
     end
30  
-    assert_raises MiniExiftool::Error do
31  
-      MiniExiftool.new __FILE__ # file type wich Exiftool can not handle
32  
-    end
33  
-    begin
34  
-      MiniExiftool.new __FILE__ # file type wich Exiftool can not handle
35  
-    rescue MiniExiftool::Error => e
36  
-      assert_match /Error: Unknown (?:image|file) type/, e.message
37  
-    end
38 30
   end
39 31
 
40 32
   def test_command
10  test/test_dumping.rb
@@ -76,14 +76,4 @@ def test_heuristics_for_restoring_numerical
76 76
     assert_equal true, MiniExiftool.from_yaml(numerical.to_yaml).numerical
77 77
   end
78 78
 
79  
-  def test_heuristics_for_restoring_timestamps
80  
-    standard = @mini_exiftool.to_hash
81  
-    timestamps = MiniExiftool.new(@filename_test, :timestamps => DateTime).to_hash
82  
-    assert_equal Time, MiniExiftool.from_hash(standard).timestamps
83  
-    assert_equal DateTime, MiniExiftool.from_hash(timestamps).timestamps
84  
-    # Doesn't work yet.
85  
-    # assert_equal Time, MiniExiftool.from_yaml(standard.to_yaml).timestamps
86  
-    # assert_equal DateTime, MiniExiftool.from_yaml(timestamps.to_yaml).timestamps
87  
-  end
88  
-
89 79
 end
2  test/test_read.rb
@@ -25,7 +25,7 @@ def test_conversion
25 25
     assert_kind_of Float, @mini_exiftool['MaxApertureValue']
26 26
     assert_kind_of String, @mini_exiftool.flash
27 27
     assert_kind_of Fixnum, @mini_exiftool['ExposureCompensation']
28  
-    assert_kind_of String, @mini_exiftool['SubjectLocation']
  28
+    assert_kind_of String, (@mini_exiftool['SubjectLocation'] || @mini_exiftool['SubjectArea'])
29 29
     assert_kind_of Array, @mini_exiftool['Keywords']
30 30
     assert_kind_of String, @mini_exiftool['SupplementalCategories']
31 31
     assert_kind_of Array, @mini_exiftool['SupplementalCategories'].to_a
2  test/test_read_numerical.rb
@@ -22,7 +22,7 @@ def test_conversion_numerical
22 22
     assert_kind_of Fixnum, @mini_exiftool_num.flash
23 23
     assert_kind_of String, @mini_exiftool_num.exif_version
24 24
     assert_kind_of Fixnum, @mini_exiftool_num['ExposureCompensation']
25  
-    assert_kind_of String, @mini_exiftool_num['SubjectLocation']
  25
+    assert_kind_of String, (@mini_exiftool_num['SubjectLocation'] || @mini_exiftool_num['SubjectArea'])
26 26
     assert_kind_of Array, @mini_exiftool_num['Keywords']
27 27
     assert_kind_of String, @mini_exiftool_num['SupplementalCategories']
28 28
     assert_kind_of Array, @mini_exiftool_num['SupplementalCategories'].to_a
2  test/test_save.rb
@@ -32,7 +32,7 @@ def test_non_allowed_value
32 32
     result = @mini_exiftool.save
33 33
     assert_equal false, result
34 34
     assert_equal 1, @mini_exiftool.errors.size
35  
-    assert_equal("Can't convert IFD0:Orientation (not in PrintConv)",
  35
+    assert_match(/Can't convert IFD0:Orientation \(not in PrintConv\)/,
36 36
                  @mini_exiftool.errors['Orientation'])
37 37
     assert @mini_exiftool.changed?
38 38
     assert @mini_exiftool.changed_tags.include?('Orientation')

0 notes on commit 9b0547a

Please sign in to comment.
Something went wrong with that request. Please try again.