Class: TestFachinfoDocParser9

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
ext/fiparse/test/test_fachinfo_doc_parser.rb

Defined Under Namespace

Classes: ReplHandler

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



973
974
975
976
977
978
979
980
981
982
983
984
985
# File 'ext/fiparse/test/test_fachinfo_doc_parser.rb', line 973

def setup
  @filename = File.expand_path('data/doc/Calcitriol_f.doc', 
    File.dirname(__FILE__))
  @text_handler = ODDB::FiParse::FachinfoTextHandler.new
  @parser = Rwv2.create_parser(@filename)
  @parser.set_text_handler(@text_handler)
  @table_handler = @text_handler.table_handler
  @parser.set_table_handler(@table_handler)
  @parser.set_inline_replacement_handler(ReplHandler.new)
  @parser.parse
  @text_handler.cutoff_fontsize = @text_handler.max_fontsize
  @parser.parse
end

- (Object) test_name9



989
990
991
992
993
994
995
# File 'ext/fiparse/test/test_fachinfo_doc_parser.rb', line 989

def test_name9
  ## the difficulty here is that we have no uniquely largest fontsize.
  assert_equal(1, @text_handler.writers.size)
  writer = @text_handler.writers.first
  assert_equal("Calcitriol Salmon Pharma\n", writer.name)
  assert_equal(20, writer.chapters.length)
end

- (Object) test_registration_owner9



996
997
998
999
1000
1001
# File 'ext/fiparse/test/test_fachinfo_doc_parser.rb', line 996

def test_registration_owner9
  writer = @text_handler.writers.first
  chapter = writer.registration_owner
  assert_instance_of(ODDB::Text::Chapter, chapter)
  assert_match(/Titulaire de l.*autorisation/, chapter.heading)
end

- (Object) test_test



986
987
988
# File 'ext/fiparse/test/test_fachinfo_doc_parser.rb', line 986

def test_test
  assert(true)
end