Sha256: afa8b272b8ba2312174c6ac03cadd15d92feeb46bb972f0be9645ddd510a2960

Contents?: true

Size: 747 Bytes

Versions: 4

Compression:

Stored size: 747 Bytes

Contents

#! /usr/bin/env ruby
# coding: utf-8

require 'helper'
require "test/unit"
require "imageutils/nefparser.rb"

class TC_NefParser < Test::Unit::TestCase
	def setup
		@np00 = NefParser.new
	end

	def test_taken_date

		data = File.open("test/001.nef", "r").read
		assert_equal(Time.mktime(2011, 8, 12, 5, 50, 33), @np00.taken_date(data))

		data = File.open("test/001.nef", "r").read(372+19)
		assert_equal(Time.mktime(2011, 8, 12, 5, 50, 33), @np00.taken_date(data))

		# String でないときに例外。
		data = File.open("test/001.nef", "r").readlines
		assert_raise(NefParserTypeError){@np00.taken_date(data)}

		# NEF と異なるときに例外のテスト
		assert_raise(NefParserNotNefError){@np00.taken_date("Not NEF data")}

	end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
imagut-0.0.3 test/test_nefparser.rb
imagut-0.0.2 test/test_nefparser.rb
imagut-0.0.1 test/test_nefparser.rb
imagut-0.0.0 test/test_nefparser.rb