Sha256: 8a13ecd9d921fc6d6c84fc7f1252bbc3e213c73e0a8109bd792097c2ae605e86

Contents?: true

Size: 768 Bytes

Versions: 4

Compression:

Stored size: 768 Bytes

Contents

#!/usr/bin/env ruby

require 'test/unit'
require 'mahoro'

class MahoroTestCase < Test::Unit::TestCase

	def initialize(*args)
		super
		@m = Mahoro.new
	end

	def test_file
		@m.flags = Mahoro::NONE
		assert_equal('ASCII C program text', @m.file('mahoro.c'))
	end

	def test_mime_file
		@m.flags = Mahoro::MIME
		assert_equal('text/x-c; charset=us-ascii', @m.file('mahoro.c'))
	end

	def test_buffer
		@m.flags = Mahoro::NONE
		assert_equal('ASCII C program text',
		             @m.buffer(File.read('mahoro.c')))
	end

	def test_mime_buffer
		@m.flags = Mahoro::MIME
		assert_equal('text/x-c; charset=us-ascii',
		             @m.buffer(File.read('mahoro.c')))
	end

	def test_valid
		assert(@m.valid?, 'Default database was not valid.')
	end

end

# arch-tag: test

Version data entries

4 entries across 2 versions & 1 rubygems

Version Path
catori-0.2.5 ./ext/mahoro-0.1/test.rb
catori-0.2.5 ext/mahoro-0.1/test.rb
catori-0.2.6 ./ext/mahoro-0.1/test.rb
catori-0.2.6 ext/mahoro-0.1/test.rb