Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

46 lines (38 sloc) 1.307 kb
# -- encoding: utf-8 --
require 'fileutils'
require 'tempfile'
require 'helpers_for_test'
class TestSpecial < TestCase
CAPTION_ABSTRACT = 'Some text for caption abstract'
def setup
data_dir = File.dirname(__FILE__) + '/data'
temp_file = Tempfile.new('test')
temp_file.close
@temp_filename = temp_file.path
org_filename = data_dir + '/Canon.jpg'
FileUtils.cp org_filename, @temp_filename
@canon = MiniExiftool.new @temp_filename
end
# Catching bug [#8073]
# Thanks to Eric Young
def test_special_chars
assert_not_nil @canon['Self-timer']
assert_not_nil @canon.self_timer
# preserving the original tag name
assert @canon.tags.include?('Self-timer') || @canon.tags.include?('SelfTimer')
assert !@canon.tags.include?('self_timer')
end
# Catching bug with writing caption-abstract
# Thanks to Robin Romahn
def test_caption_abstract_sensitive
@canon['caption-abstract'] = CAPTION_ABSTRACT
assert @canon.changed_tags.include?('Caption-Abstract')
assert @canon.save
assert_equal CAPTION_ABSTRACT, @canon.caption_abstract
end
def test_caption_abstract_non_sesitive
@canon.caption_abstract = CAPTION_ABSTRACT.reverse
assert @canon.save
assert_equal CAPTION_ABSTRACT.reverse, @canon.caption_abstract
end
end
Jump to Line
Something went wrong with that request. Please try again.