Class: MahoroTestCase
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- MahoroTestCase
- Defined in:
- ext/mahoro-0.1/test.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ MahoroTestCase
constructor
A new instance of MahoroTestCase.
- #test_buffer ⇒ Object
- #test_file ⇒ Object
- #test_mime_buffer ⇒ Object
- #test_mime_file ⇒ Object
- #test_valid ⇒ Object
Constructor Details
#initialize(*args) ⇒ MahoroTestCase
Returns a new instance of MahoroTestCase.
8 9 10 11 |
# File 'ext/mahoro-0.1/test.rb', line 8 def initialize(*args) super @m = Mahoro.new end |
Instance Method Details
#test_buffer ⇒ Object
23 24 25 26 27 |
# File 'ext/mahoro-0.1/test.rb', line 23 def test_buffer @m.flags = Mahoro::NONE assert_equal('ASCII C program text', @m.buffer(File.read('mahoro.c'))) end |
#test_file ⇒ Object
13 14 15 16 |
# File 'ext/mahoro-0.1/test.rb', line 13 def test_file @m.flags = Mahoro::NONE assert_equal('ASCII C program text', @m.file('mahoro.c')) end |
#test_mime_buffer ⇒ Object
29 30 31 32 33 |
# File 'ext/mahoro-0.1/test.rb', line 29 def test_mime_buffer @m.flags = Mahoro::MIME assert_equal('text/x-c; charset=us-ascii', @m.buffer(File.read('mahoro.c'))) end |
#test_mime_file ⇒ Object
18 19 20 21 |
# File 'ext/mahoro-0.1/test.rb', line 18 def test_mime_file @m.flags = Mahoro::MIME assert_equal('text/x-c; charset=us-ascii', @m.file('mahoro.c')) end |
#test_valid ⇒ Object
35 36 37 |
# File 'ext/mahoro-0.1/test.rb', line 35 def test_valid assert(@m.valid?, 'Default database was not valid.') end |