Kouhei Sutou
null+****@clear*****
Tue Feb 18 00:16:23 JST 2014
Kouhei Sutou 2014-02-18 00:16:23 +0900 (Tue, 18 Feb 2014) New Revision: 3b72713e0dded1caeea39f4255d6f79444fc0666 https://github.com/ranguba/chupa-text-decomposer-libreoffice/commit/3b72713e0dded1caeea39f4255d6f79444fc0666 Message: test: normalize LibreOffice version Modified files: test/helper.rb test/test-doc.rb test/test-docx.rb test/test-odp.rb test/test-ods.rb test/test-odt.rb test/test-ppt.rb test/test-pptx.rb test/test-xls.rb test/test-xlsx.rb Modified: test/helper.rb (+9 -0) =================================================================== --- test/helper.rb 2014-02-18 00:11:16 +0900 (125e461) +++ test/helper.rb 2014-02-18 00:16:23 +0900 (09a1523) @@ -42,4 +42,13 @@ module DecomposeHelper end decomposed end + + def normalize_producer(producer) + return nil if producer.nil? + if /\ALibreOffice \d\.\d\z/ =~ producer + "LibreOffice X.Y" + else + producer + end + end end Modified: test/test-doc.rb (+2 -1) =================================================================== --- test/test-doc.rb 2014-02-18 00:11:16 +0900 (dcf9783) +++ test/test-doc.rb 2014-02-18 00:16:23 +0900 (6fff3c2) @@ -80,7 +80,8 @@ class TestDoc < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-docx.rb (+2 -1) =================================================================== --- test/test-docx.rb 2014-02-18 00:11:16 +0900 (23b38ab) +++ test/test-docx.rb 2014-02-18 00:16:23 +0900 (7c9c6b0) @@ -80,7 +80,8 @@ class TestDocx < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-odp.rb (+2 -1) =================================================================== --- test/test-odp.rb 2014-02-18 00:11:16 +0900 (522c8c5) +++ test/test-odp.rb 2014-02-18 00:16:23 +0900 (124a28c) @@ -82,7 +82,8 @@ class TestOdp < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-ods.rb (+2 -1) =================================================================== --- test/test-ods.rb 2014-02-18 00:11:16 +0900 (140b2b7) +++ test/test-ods.rb 2014-02-18 00:16:23 +0900 (c7e98e9) @@ -80,7 +80,8 @@ class TestOds < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-odt.rb (+2 -1) =================================================================== --- test/test-odt.rb 2014-02-18 00:11:16 +0900 (d3e0c70) +++ test/test-odt.rb 2014-02-18 00:16:23 +0900 (01ba976) @@ -80,7 +80,8 @@ class TestOdt < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-ppt.rb (+2 -1) =================================================================== --- test/test-ppt.rb 2014-02-18 00:11:16 +0900 (f5b2ba8) +++ test/test-ppt.rb 2014-02-18 00:16:23 +0900 (27c3ebd) @@ -82,7 +82,8 @@ class TestPpt < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-pptx.rb (+2 -1) =================================================================== --- test/test-pptx.rb 2014-02-18 00:11:16 +0900 (68d77c7) +++ test/test-pptx.rb 2014-02-18 00:16:23 +0900 (153b875) @@ -86,7 +86,8 @@ class TestPptx < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-xls.rb (+2 -1) =================================================================== --- test/test-xls.rb 2014-02-18 00:11:16 +0900 (42a96ad) +++ test/test-xls.rb 2014-02-18 00:16:23 +0900 (ece12ca) @@ -80,7 +80,8 @@ class TestXls < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date Modified: test/test-xlsx.rb (+2 -1) =================================================================== --- test/test-xlsx.rb 2014-02-18 00:11:16 +0900 (547e28e) +++ test/test-xlsx.rb 2014-02-18 00:16:23 +0900 (49d3042) @@ -80,7 +80,8 @@ class TestXlsx < Test::Unit::TestCase end def test_producer - assert_equal(["LibreOffice 4.1"], decompose("producer")) + assert_equal(["LibreOffice X.Y"], + normalize_producer(decompose("producer"))) end def test_creation_date -------------- next part -------------- HTML����������������������������...Download