Class: ODDB::OdbaExporter::TestLimTxtTable

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
ext/export/test/test_oddbdat.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) test_lines



676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
# File 'ext/export/test/test_oddbdat.rb', line 676

def test_lines
  # test package.sl_entry nil case
  package = ODDB::Package.new('12')
  @limtxttable = LimTxtTable.new
  assert_equal([], @limtxttable.lines(package))

  # test not nil case
  package.create_sl_entry
  package.sl_entry.create_limitation_text
  flexstub(package).should_receive(:oid).and_return(123)
  paragraph  = flexmock('par') do |par|
    par.should_receive(:text).and_return('text')
  end
  paragraphs = [paragraph]
  chap = flexmock('chap') do |cha|
    cha.should_receive(:paragraphs).and_return(paragraphs)
  end
  package.sl_entry.limitation_text.descriptions['lang'] = chap

  # test
  flexstub(LimTxtLine).should_receive(:new).with(123000, 'L', 'text').and_return('limtxtline')
  assert_equal(['limtxtline'], @limtxttable.lines(package))
end