diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-01-31 09:10:12 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-01-31 09:10:12 +0000 |
commit | c122d7cc3e342d17014d8571634e55477286d928 (patch) | |
tree | 42cf89f6925395e57024d9be42a99ffcb09db4cd | |
parent | ea0455e966a95f7a4be0c8f4b9c0481f0392ff39 (diff) | |
download | mahoro-c122d7cc3e342d17014d8571634e55477286d928.tar.gz |
test: workaround for mime output variation
libmagic seems to vary between different OSes, and we're not the only ones with this problem ref: http://search.cpan.org/~fitzner/File-LibMagic-0.96/LibMagic.pm#BUGS
-rwxr-xr-x | test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -17,7 +17,10 @@ class MahoroTestCase < Test::Unit::TestCase def test_mime_file @m.flags = Mahoro::MIME - assert_equal('text/x-c; charset=us-ascii', @m.file('mahoro.c')) + assert({ + 'text/x-c; charset=us-ascii' => true, + 'text/x-c charset=us-ascii' => true + }.include?(@m.file('mahoro.c'))) end def test_buffer @@ -28,8 +31,10 @@ class MahoroTestCase < Test::Unit::TestCase def test_mime_buffer @m.flags = Mahoro::MIME - assert_equal('text/x-c; charset=us-ascii', - @m.buffer(File.read('mahoro.c'))) + assert({ + 'text/x-c; charset=us-ascii' => true, + 'text/x-c charset=us-ascii' => true + }.include?(@m.buffer(File.read('mahoro.c')))) end def test_valid |