Sha256: dd7351a940f96b2ad837c8cf29a649542c777c00c064e037cb6c331c82dff2b3

Contents?: true

Size: 1.2 KB

Versions: 3

Compression:

Stored size: 1.2 KB

Contents

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

require "test/unit"
require "filerenamer/filerenameroptionparser.rb"

class TC_FileRenamerOptionParser < Test::Unit::TestCase
	#def setup
	#	@frop00 = FileRenamerOptionParser.new
	#end

	def test_sanity_check
		frop01 = FileRenamerOptionParser.new
		ary = %w(-y --copy)
		frop01.parse(ary)
		assert_equal( { :yes => true, :copy => true }, frop01.options)

		# このクラスではオプションの整合性チェックは行わない。
		frop01 = FileRenamerOptionParser.new
		ary = %w(-y -n)
		frop01.parse(ary)
		assert_equal( { :yes => true, :no => true }, frop01.options)

		frop01 = FileRenamerOptionParser.new
		ary = %w(-y -n -c -m -h -s -q)
		frop01.parse(ary)
		corrects = {
			:yes => true,
			:no => true,
			:copy => true,
			:move => true,
			:hardlink => true,
			:symlink => true,
			:quiet => true
		}
		assert_equal(corrects, frop01.options)

		frop01 = FileRenamerOptionParser.new
		ary = %w(--yes --no --copy --move --hardlink --symlink --quiet)
		frop01.parse(ary)
		corrects = {
			:yes => true,
			:no => true,
			:copy => true,
			:move => true,
			:hardlink => true,
			:symlink => true,
			:quiet => true
		}
		assert_equal(corrects, frop01.options)
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
filerenamer-0.0.2 test/test_filerenameroptionparser.rb
filerenamer-0.0.1 test/test_filerenameroptionparser.rb
filerenamer-0.0.0 test/test_filerenameroptionparser.rb